Skip to contents

Method to initialize transformations (e.g., scaling, centering) for hyperdesign objects. Each block in the hyperdesign gets its own transformation object.

Usage

# S3 method for class 'hyperdesign'
init_transform(x, X, ...)

Arguments

x

A hyperdesign object

X

A preprocessing specification (e.g., from recipes package)

...

Additional arguments (not used)

Value

A hyperdesign with transformed data and a preproc attribute containing the fitted preprocessing objects

Examples

if (FALSE) { # \dontrun{
d1 <- multidesign(matrix(rnorm(10*5), 10, 5),
                  data.frame(cond = rep(c("A","B"), 5)))
d2 <- multidesign(matrix(rnorm(10*5), 10, 5),
                  data.frame(cond = rep(c("A","B"), 5)))
hd <- hyperdesign(list(d1, d2))
hd_transformed <- init_transform(hd, recipes::recipe(~ ., data = as.data.frame(d1$x)))
} # }