prcomp {stats} | R Documentation |
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.
prcomp(x,
scale = FALSE,
center = FALSE,
pc = 5,
list = TRUE,
threshold = 1E-07);
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.