Skip to contents

Creates a new multiframe object containing only observations that meet specified conditions based on design variables. The lazy-evaluated observation closures remain valid in the subset.

Usage

# S3 method for class 'multiframe'
subset(x, fexpr, ...)

Arguments

x

A multiframe object

fexpr

An expression used to filter observations based on design variables

...

Additional arguments (not used)

Value

A new multiframe object containing only matching observations, or NULL if no matches

Examples

X <- matrix(rnorm(20 * 5), 20, 5)
Y <- data.frame(
  condition = rep(c("A", "B"), each = 10),
  block = rep(1:4, each = 5)
)
mf <- multiframe(X, Y)
mf_A <- subset(mf, condition == "A")