biplot.PCAloc: Biplot for PCAloc

View source: R/sparsePCAloc_methods.R

biplot.PCAlocR Documentation

Biplot for PCAloc

Description

Biplot for PCAloc

Usage

## S3 method for class 'PCAloc'
biplot(x, ...)

Arguments

x

object of class PCAloc.

...

other input arguments, see details.

Details

Additional parameters that can be given to the function are:

shape point shape
size point size
alpha transparency
color either "variable" or "groups" indication how points should be coloured.

Value

Returns version of biplot for PCAloc object.

Examples

# set seed
set.seed(236)

# make data
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
biplot(pca, alpha = 0.4, shape = 16, size = 2, color = "variable")

ssMRCD documentation built on Sept. 11, 2024, 5:14 p.m.