subset_subcondition: subset by subcondition

Description Usage Arguments Value Examples

View source: R/subset_subcondition.R

Description

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.

Usage

1
subset_subcondition(x, meta.var = NULL, ..., select = NULL)

Arguments

meta.var

the meta variable

...

condition for subsetting passed to subset

data

the data, a data frame or some such thing

Value

a data frame

Examples

1
2
3
4
5
6
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)

renlund/dm documentation built on Jan. 18, 2022, 9:50 a.m.