View source: R/sparsePCAloc_methods.R
plot_loadings | R Documentation |
Plots of loadings of PCAloc object
plot_loadings(object, ...)
object |
object of class PCAloc |
... |
other input arguments, see details. |
Additional parameters that can be given to the function are:
text | logical if values should be added as text. |
size | point size. |
tolerance | tolerance for rounding to zero. |
k | integer, which component scores should be plotted. |
groupnames | names of groups. |
varnames | names of variables. |
textrotate | angle of text rotation, if included. |
Returns loading heatmap for component k
.
# 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 score distances
plot_loadings(object = pca,
k = 1,
size = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.