View source: R/subset_subcondition.R
subset_subcondition | R Documentation |
this function subsets by some condition, but returns all information associated with those values of the meta variable 'meta.var' that would be in the standard subset returned by the same condition.
subset_subcondition(x, meta.var = NULL, ..., select = NULL)
x |
the data, a data frame or some such thing |
meta.var |
the meta variable |
... |
condition for subsetting passed to |
select |
vector of variable names to select |
a data frame
d <- data.frame(id = rep(LETTERS[1:2], each = 2), z = 1:4)
## 'subset' returns the rows satisfying the condition
subset(d, z == 4)
## 'subset_subcondition' returns all rows such that the 'meta.var' value is
## in the standard subset returned, i.e. a (possibly) bigger set
subset_subcondition(d, meta.var = "id", z == 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.