match_multi {jwutil} | R Documentation |
This provides a succinct way to query a data frame for conditions, which is otherwise very verbose in base R or dplyr
match_multi(x, cols, table, incomparables = NULL)
x |
data.frame |
cols |
character vector of column names to be found in |
table |
vector of items to find |
incomparables |
passed on to the base function |
matrix with same number of rows as x
, and a column for each of
cols
j <- cars[1:10, ] match_multi(j, "speed", 7) match_multi(j, "dist", 22) match_multi(j, c("speed", "dist"), 10) match_multi(j, c("speed", "dist"), c(7, 17))