rgcca_transform: RGCCA Transform

View source: R/rgcca_transform.R

rgcca_transformR Documentation

RGCCA Transform

Description

Project blocks of data on canonical components extracted with a RGCCA model.

Usage

rgcca_transform(rgcca_res, blocks_test = rgcca_res$call$blocks)

Arguments

rgcca_res

A fitted RGCCA object (see rgcca).

blocks_test

A list of either dataframes or matrices to be projected.

Value

A list of matrices containing the projections of the test blocks using the canonical components from the fitted RGCCA object.

Examples

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)

Tenenhaus/RGCCA documentation built on March 16, 2023, 2:04 p.m.