Skip to contents

Splits a multidesign object into multiple objects based on combinations of one or more design variables.

Usage

# S3 method for class 'multidesign'
split(x, f, drop = FALSE, ...)

Arguments

x

A multidesign object

f

Unquoted name of the first variable to split by

drop

Logical; unused, present for compatibility with the generic

...

Additional unquoted names of variables to split by

Value

A list of multidesign objects, one for each combination of splitting variables

Examples

X <- matrix(rnorm(100*20), 100, 20)
Y <- tibble::tibble(
  condition = rep(c("A", "B"), each=50),
  block = rep(1:2, times=50)
)
mds <- multidesign(X, Y)

# Split by condition
split_by_cond <- split(mds, condition)

# Split by condition and block
split_by_both <- split(mds, condition, block)