prcomp {mva} | R Documentation |
This function performs a principal components analysis on
the given data matrix and returns the results as a
prcomp
object. The print method for the these
objects prints the results in a nice format and the
plot method produces a scree plot.
prcomp(x=, scale=FALSE, use="all.obs")
print.prcomp(prcomp.obj)
plot.prcomp(prcomp.obj)
x |
a matrix (or data frame) which provides the data for the principal components analysis. |
scale |
a logical value indicating whether the variables should be scaled to have unit variance before the analysis takes place. |
use |
the strategy to use for dealing with missing observations.
The possible values are |
prcomp
returns an list with class "prcomp"
containing the following components:
var |
the variances of the principal components (i.e. the eigenvalues) |
load |
the matrix of variable loadings (i.e. a matrix whose columns contain the eigenvectors). |
scale |
the value of the |
Mardia, K. V., J. T. Kent and J. M. Bibby (1979). Multivariate Analysis, London: Academic Press.
cor
, cov
, eigen
.
# the variances of the variables in the
# crimes data vary by orders of magnitude
data(crimes)
prcomp(crimes)
prcomp(crimes,scale=TRUE)