Function to perform PCA on a matrix

pca(X, type)

Arguments

X

matrix to apply PCA on

type

PCA (no rescale) or SPCA (rescale)

Value

list of PCA parameters (PCs from X, mean, eigenvectors and values)