View source: R/sparsePCAloc_methods.R
screeplot.PCAloc | R Documentation |
Screeplot for PCAloc
## S3 method for class 'PCAloc'
screeplot(x, ...)
x |
object of class PCAloc. |
... |
other input arguments, see details. |
Additional parameters that can be given to the function are:
text | logical if text should be plotted |
size | text size |
cutoff | cutoff line for scree plot |
groupnames | name of groups |
textrotate | angle of text, if text is plotted. |
Returns version of scree plot and cumulative explained variance per group for PCAloc object.
# set seed
set.seed(236)
data = matrix(rnorm(2000), ncol = 4)
groups = sample(1:10, 500, replace = TRUE)
W = time_weights(N = 10, c(3,2,1))
# calculate covariance matrices
covs = ssMRCD(data, groups = groups, weights = W, lambda = 0.3)
# sparse PCA
pca = sparsePCAloc(eta = 0.3, gamma = 0.7, cor = FALSE, COVS = covs$MRCDcov,
n_max = 1000, increase_rho = list(TRUE, 50, 1), trace = FALSE)
# plot biplot
screeplot(pca, text = TRUE, cutoff = 0.8, size = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.