View source: R/extrafunctions.R
match_rows | R Documentation |
For a data frames 'x' and 'target', the function will return a matrix mapping the rows of 'x' to those of 'target'.
match_rows(x, target, by)
x |
data.frame |
target |
data.frame to map to |
by |
vector of strings naming columns in 'x' and 'target' |
'x' is a data frame with n rows and 'target' a data frame with m rows. This function will return a n times m matrix that maps the rows of 'x' to those of 'target' based on the values in the columns specified by the argument 'by'
A matrix with nrow(x) rows and nrow(target) columns
df <- nelder(~(cl(10)*t(5)) > ind(10))
df_unique <- df[!duplicated(df[,c('cl','t')]),]
match_rows(df,df_unique,c('cl','t'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.