prcomp {stats} R Documentation

Principal Components Analysis

Description


Performs a principal components analysis on the given data matrix
and returns the results as an object of class prcomp.

The calculation is done by a singular value decomposition of the
(centered and possibly scaled) data matrix, not by using eigen on
the covariance matrix. This is generally the preferred method for
numerical accuracy. The print method for these objects prints the
results in a nice format and the plot method produces a scree
plot.

Unlike princomp, variances are computed With the usual divisor N - 1.
Note that scale = True cannot be used If there are zero Or constant
(For center = True) variables.

Usage

prcomp(x,
    scale = FALSE,
    center = FALSE,
    pc = 5,
    list = TRUE,
    threshold = 1E-07);

Arguments

x

a numeric or complex matrix (or data frame) which provides the data for the principal components analysis.

center

a logical value indicating whether the variables should be shifted to be zero centered. Alternately, a vector of length equal the number of columns of x can be supplied. The value is passed to scale. [as boolean]

scale

a logical value indicating whether the variables should be scaled to have unit variance before the analysis takes place. The default is FALSE for consistency with S, but in general scaling is advisable. Alternatively, a vector of length equal the number of columns of x can be supplied. The value is passed to scale. [as boolean]

Details

The signs of the columns of the rotation matrix are arbitrary, and so may differ between different programs for PCA, and even between different builds of R.

Authors

sciBASIC.NET

Value

this function returns data object of type MultivariateAnalysisResult.

clr value class

Examples


[Package stats version 5.0.1.2389 Index]