Skip to contents

Performs dimensionality reduction on the data matrix of a multidesign object while preserving the design structure. By default uses PCA, but supports any reduction method that returns a projector object.

Usage

reduce.multidesign(
  x,
  nc = 2,
  ...,
  rfun = function(x) multivarious::pca(x$x, ncomp = nc, ...)
)

Arguments

x

A multidesign object

nc

Number of components to retain in the reduction

...

Additional arguments passed to rfun

rfun

Function to perform dimensionality reduction, must return a projector object

Value

A reduced_multidesign object containing:

x

The reduced data matrix

design

Original design information

projector

The projection object used for reduction

Examples

if (FALSE) { # \dontrun{
X <- matrix(rnorm(100*20), 100, 20)
Y <- tibble::tibble(condition = rep(letters[1:4], each=25))
mds <- multidesign(X, Y)

# Reduce to 5 components using PCA
reduced_mds <- reduce(mds, nc=5)
} # }