getLoadingsFromPCA: An interface to get load/score matrix or eigenvalues from...

Description Usage Arguments Details Value Examples

View source: R/getLoadingsFromPCA.R

Description

As we have a lot of packages with a lot of PCA functions available, we need to establish an interface between the PCA functions and Variable Selection process. For this, we have two functions: getLoadingsFromPCA and getScoresFromPCA. They let us to get the load and score, respectively, from any PCA function of any package. If you are interested in a PCA function of another package not used in the SUPCAVS package, you can rewrite these functions for your needs.

Usage

1
2
3

Arguments

x

This is a PCA object.

Details

The PCA object can come from prcomp or princomp functions. It can also come from pcaMethods library.

Value

The returned value is:

getLoadingsFromPCA: returns a matrix of loads from PCA.

getScoresFromPCA: returns a score matrix (data set transformed by PCA transformations).

getEigenvalueFromPCA: returns a eigenvalue vector.

Examples

1
2
3
4
5
6
7
8
  x = matrix(rnorm(100), 20,5, 
             dimnames=list(NULL, paste('X', 1:5, sep='')))

  pc = prcomp(x)
  
  pcaLoadMatrix = getLoadingsFromPCA(pc)
  pcaScoreMatrix = getScoresFromPCA(pc)
  pcaEigenvalues = getEigenvaluesFromPCA(pc)

juscelino-izidoro/supcavs documentation built on Jan. 2, 2022, 7:49 a.m.