View source: R/mergewithorder.R
mergewithorder | R Documentation |
This function merges two dataset without changing the order of the base dataset.
mergewithorder(df1, df2, by = NULL)
df1 |
a data frame object, the order of which needs to be unchanged. |
df2 |
a data frame object be joined with |
by |
unique identifiers used to join |
a joined data frame with the same order as df1
merge
data(mobility)
mobility$distgroup<- groupdist(mobility, coor = c("lon", "lat"), threshold = 100, groupvar = "id")
latmean<- aggregate(lat~distgroup, mobility, mean)
names(latmean)<- c("distgroup","latmean")
mobility<- mergewithorder(mobility, latmean, by = "distgroup")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.