## Plotting of an rgcca object
data("Russett")
blocks <- list(
agriculture = Russett[, seq(3)],
industry = Russett[, 4:5],
politic = as.factor(apply(Russett[, 9:11], 1, which.max))
)
blocks2 <- list(
agriculture = Russett[, seq(3)],
industry = Russett[, 4:5],
politic = Russett[, 6:11]
)
status <- colnames(Russett)[9:11][apply(Russett[, 9:11], 1, which.max)]
fit_rgcca <- rgcca(blocks = blocks, response = 3, ncomp = 2)
plot(fit_rgcca, type = "sample", block = 1:2, comp = 1)
plot(fit_rgcca, type = "loadings")
plot(fit_rgcca, type = "weight")
plot(fit_rgcca, type = "sample")
plot(fit_rgcca, type = "cor_circle")
plot(fit_rgcca, type = "both")
plot(fit_rgcca, type = "biplot")
plot(fit_rgcca, type = "ave")
if (FALSE) {
# With a superblock
fit_mcoa <- rgcca(blocks = blocks2, method = "mcoa", ncomp = 2)
plot(fit_mcoa, type = "both", response = status)
plot(fit_mcoa, type = "biplot", response = status)
## Plotting of an rgcca_cv object
cv_out <- rgcca_cv(blocks,
response = 3, method = "rgcca",
par_type = "tau",
par_value = 1,
n_run = 1, n_cores = 1,
prediction_model = "lda",
metric = "Accuracy",
verbose = TRUE
)
plot(cv_out, type = "sd")
plot(cv_out, type = "quantile")
## Ploting of an rgcca_permutation object
perm_out <- rgcca_permutation(blocks2, par_type = "tau",
n_perms = 2, n_cores = 1)
plot(perm_out, type = "crit")
plot(perm_out, type = "zstat")
## Plotting of an rgcca_bootstrap object
boot_out <- rgcca_bootstrap(fit_rgcca, n_boot = 20, n_cores = 1)
plot(boot_out, type = "weights", block = 1, comp = 1)
plot(boot_out, type = "loadings", comp = 2,
display_order = FALSE, show_stars = FALSE)
## Plotting of an rgcca_stability object
fit.sgcca <- rgcca(blocks2, sparsity = c(.8, .9, .6))
res <- rgcca_stability(
fit.sgcca, n_boot = 10, verbose = TRUE, keep = rep(.1, 3)
)
plot(res, type = "samples")
}
Run the code above in your browser using DataLab