improve: Improve the information on sgcca classes

View source: R/analyse_sgcca.R

improveR Documentation

Improve the information on sgcca classes

Description

Add names to data returned by rgcca or sgcca, simplify AVE output

Usage

improve(sgcca, namesA)

Arguments

sgcca

An object of class sgcca or rgcca.

namesA

The names of the original data

Value

An object of class sgcca or rgcca

Examples

data("Russett", package = "RGCCA")
X_agric <- as.matrix(Russett[, c("gini", "farm", "rent")])
X_ind <- as.matrix(Russett[, c("gnpr", "labo")])
X_polit <- as.matrix(Russett[ , c("inst", "ecks",  "death", "demostab",
                                  "dictator")])
A <- list(X_agric, X_ind, X_polit)
A <- lapply(A, function(x) scale2(x, bias = TRUE))
C <- matrix(c(0, 0, 1, 0, 0, 1, 1, 1, 0), 3, 3)
out <- RGCCA::rgcca(A, C, tau = rep(0, 3), scheme = "factorial",
                    scale = FALSE, verbose = FALSE, ncomp = rep(2, length(A)))
out$AVE
out <- improve(out, c("Agric", "Ind", "Polit"))
out$AVE

llrs/inteRmodel documentation built on April 1, 2022, 4:04 p.m.