\Header{prcomp}{Principal Components Analysis}
\alias{print.prcomp}{prcomp}
\alias{plot.prcomp}{prcomp}
\keyword{multivariate}{prcomp}
\begin{Usage}
\begin{verbatim}
prcomp(x=, scale=FALSE, use="all.obs")

print.prcomp(prcomp.obj)
plot.prcomp(prcomp.obj)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{x}] a matrix (or data frame) which provides the data
for the principal components analysis.
\item[\texttt{scale}] a logical value indicating whether the variables should
be scaled to have unit variance before the analysis takes place.
\item[\texttt{use}] the strategy to use for dealing with missing observations.
The possible values are \texttt{"all.obs"}, \texttt{"complete.obs"},
or \texttt{"pairwise.complete.obs"}.
An unambiguous substring can be used.
\end{ldescription}
\end{Arguments}
\begin{Description}
This function performs a principal components analysis on
the given data matrix and returns the results as a
\texttt{prcomp} object.  The print method for the these
objects prints the results in a nice format and the
plot method produces a scree plot.\end{Description}
\begin{Value}
\texttt{prcomp} returns an list with class \texttt{"prcomp"}
containing the following components:
\begin{ldescription}
\item[\texttt{var}] the variances of the principal components
(i.e. the eigenvalues)
\item[\texttt{load}] the matrix of variable loadings (i.e. a matrix
whose columns contain the eigenvectors).
\item[\texttt{scale}] the value of the \texttt{scale} argument.
\end{ldescription}
\end{Value}
\begin{References}
Mardia, K. V., J. T. Kent and J. M. Bibby (1979).
\emph{Multivariate Analysis}, London: Academic Press.\end{References}
\begin{SeeAlso}
\texttt{\Link{cor}}, \texttt{\Link{cov}}, \texttt{\Link{eigen}}.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
# the variances of the variables in the
# crimes data vary by orders of magnitude
data(crimes)
prcomp(crimes)
prcomp(crimes,scale=TRUE)
\end{ExampleCode}
\end{Examples}

