.BG
.FN prcomp
.TL
Principal Components Analysis
.CS
prcomp(x, retx=TRUE)
.AG x
data matrix to be decomposed. Principal component analysis
defines a rotation of the variables (columns) of `x'. The
first derived direction is chosen to maximize the standard
deviation of the derived variable, the second to maximize
the standard deviation among directions uncorrelated with
the first, etc.
.AG retx
logical, if `TRUE' the rotated version of the
data matrix is returned.  Using `retx=FALSE' saves space
in the returned data structure.
.RT
list describing the principal component analysis:
.RC sdev
standard deviations of the derived variables.
.RC rotation
orthogonal matrix describing the rotation. The first
column is the linear combination of columns of `x' defining
the first principal component, etc.  May have fewer columns
than `x'.
.RC x
if `retx' was `TRUE', the rotated version of `x'; i.e., the
first column is the `nrow(x)' values for the first derived
variable, etc.  May have fewer columns than `x'.
.PP
The analysis will work even if `nrow(x)<ncol(x)', but in
this case only `nrow(x)' variables will be derived, and the
returned `x' will have only `nrow(x)' columns. In general,
if any of the derived variables has zero standard deviation,
that variable is dropped from the returned result.
.KW array
.KW multivariate
.KW algebra
.WR
