View source: R/rgcca_transform.R
rgcca_transform | R Documentation |
Project blocks of data on canonical components extracted with a RGCCA model.
rgcca_transform(rgcca_res, blocks_test = rgcca_res$call$blocks)
rgcca_res |
A fitted RGCCA object (see |
blocks_test |
A list of either dataframes or matrices to be projected. |
A list of matrices containing the projections of the test blocks using the canonical components from the fitted RGCCA object.
data("Russett") blocks <- list( agriculture = Russett[, 1:3], industry = Russett[, 4:5], politic = Russett[, 6:11] ) C <- connection <- 1 - diag(3) A <- lapply(blocks, function(x) x[1:32, ]) fit.rgcca <- rgcca(A, connection = C, tau = c(0.7, 0.8, 0.7), ncomp = c(3, 2, 4), scale_block = FALSE, superblock = FALSE ) X <- lapply(blocks, function(x) x[39:47, ]) projection <- rgcca_transform(fit.rgcca, X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.