powered by
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)
data.frame
character vector of column names to be found in x
x
vector of items to find
passed on to the base function match
match
matrix with same number of rows as x, and a column for each of cols
cols
# NOT RUN { 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)) # }
Run the code above in your browser using DataLab