match_rows: Generate matrix mapping between data frames
Description
For a data frames `x` and `target`, the function will return a matrix mapping the rows of
`x` to those of `target`.
Usage
match_rows(x, target, by)
Value
A matrix with nrow(x) rows and nrow(target) columns
Arguments
x
data.frame
target
data.frame to map to
by
vector of strings naming columns in `x` and `target`
Details
`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`