data("Russett")
blocks <- list(
agriculture = Russett[, 1:3],
industry = Russett[, 4:5],
politic = Russett[, 6:11])
Xtrain <- lapply(blocks, function(x) x[1:32, ])
Xtest <- lapply(blocks, function(x) x[33:47, ])
fit_rgcca <- rgcca(Xtrain, ncomp = 2)
projection <- rgcca_transform(fit_rgcca, Xtest)
Run the code above in your browser using DataLab