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, ...)
)Value
A reduced_multidesign object containing:
- x
The reduced data matrix
- design
Original design information
- projector
The projection object used for reduction
See also
Other multidesign functions:
multidesign(),
split.multidesign(),
split_indices.multidesign(),
subset.multidesign(),
summarize_by.multidesign()
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)
} # }