View source: R/struc__subsetDfCon.R
subsetDfCon | R Documentation |
Taking a subset of a data frame in accordance with one or more conditions provided in the second data frame.
subsetDfCon(subject, conditions, col.subject = 1, col.con = 1)
subject: |
the data frame to be subset |
conditions: |
a data frame whose columns provide conditions for selecting rows in the subject. |
col.subject: |
column names or indices in the subject data frame to be searched for |
col.con: |
column names or indices in the condition data frame to be used as conditions for searching rows in the subject data frame Note that col.subject and col.con must be matched in terms of the order of comparisons. x$a1 will be searched for values in y$a1, and so forth: d <- subsetDfCon(subject = x, conditions = y, col.subject = c("a1", "a2), col.con = c("a1", "b1")) x[, 2] will be searched for values in y[, 3], for example: d <- subsetDfCon(subject = x, conditions = y, col.subject = c(1, 2, 3), col.con = c(1, 3, 5)) |
Yu Wan (wanyuac@gmail.com)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.