Skip to contents

Returns indices for splitting a multidesign object based on combinations of design variables, without actually splitting the data.

Usage

# S3 method for class 'multidesign'
split_indices(x, ..., collapse = FALSE)

Arguments

x

A multidesign object

...

Unquoted names of variables to split by

collapse

Logical; whether to collapse the resulting indices

Value

A tibble containing:

group variables

The splitting variables and their values

indices

List column of indices for each group

.splitvar

Combined string of grouping values

Examples

X <- matrix(rnorm(40*10), 40, 10)
Y <- data.frame(condition = rep(c("A","B"), each=20),
                block = rep(1:4, each=10))
mds <- multidesign(X, Y)
idx <- split_indices(mds, condition)