subset_subcondition: subset by subcondition

View source: R/subset_subcondition.R

subset_subconditionR Documentation

subset by subcondition

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

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

Arguments

x

the data, a data frame or some such thing

meta.var

the meta variable

...

condition for subsetting passed to subset

select

vector of variable names to select

Value

a data frame

Examples

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/datma documentation built on June 2, 2025, 5:12 a.m.