Learn R Programming

Cardinal (version 1.4.0)

PCA-methods: Principal Components Analysis

Description

Performs principal components analysis efficiently on large datasets using implicitly restarted Lanczos bi-diagonalization (IRLBA) algorithm for approximate singular value decomposition of the data matrix.

Usage

"PCA"(x, ncomp = 20, method = c("irlba", "svd"), scale = FALSE, ...) "predict"(object, newx, ...)

Arguments

x
The imaging dataset for which to calculate the principal components.
ncomp
The number of principal components to calculate.
method
The function used to calculate the singular value decomposition.
scale
Shoud the data be scaled first? This is passed to scale.
...
Ignored.
object
The result of a previous call to PCA.
newx
An imaging dataset for which to calculate the principal components scores based on the aleady-calculated principal components loadings.

Value

An object of class PCA, which is a ResultSet, where each component of the resultData slot contains at least the following components:
scores:
A matrix with the principal component scores.
loadings:
A matrix with the principal component loadings.
sdev:
The standard deviations of the principal components.
method:
The method used to calculate the principal components.
ncomp:
The number of principal components calculated.
center:
The center of the dataset. Used for calculating principal components scores on new data.
scale:
The scaling factors for the dataset. Used for calculating principal components scores on new data.

See Also

OPLS, PLS, irlba, svd

Examples

Run this code
sset <- generateImage(diag(4), range=c(200, 300), step=1)

pca <- PCA(sset, ncomp=2)

Run the code above in your browser using DataLab