View source: R/SRPCAMS_methods.R
| screeplot.msPCA | R Documentation |
Generates a scree plot displaying the explained variance of principal components
and a heatmap of cumulative explained variance per group for an object of class msPCA.
## S3 method for class 'msPCA'
screeplot(x, ...)
x |
An object of class |
... |
Additional arguments to customize the plot:
|
A list containing two ggplot2 plot objects:
A boxplot-based scree plot showing explained variance per principal component across groups.
A tile plot showing cumulative explained variance per group and principal component.
set.seed(236)
data <- matrix(rnorm(1500), ncol = 5)
groups <- sample(1:5, 300, replace = TRUE)
W <- time_weights(N = 5, c(3,2,1))
covs <- ssMRCD(data, groups = groups, weights = W, lambda = 0.3)
pca <- msPCA(eta = 0.3, gamma = 0.7, COVS = covs$MRCDcov)
screeplot(pca, text = TRUE, cutoff = 0.8, size = 4, textrotate = 0)
screeplot(pca, text = FALSE, cutoff = 0.6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.