\HeaderA{screeplot}{Screeplots}{screeplot}
\methaliasA{screeplot.default}{screeplot}{screeplot.default}
\keyword{multivariate}{screeplot}
\begin{Description}\relax
\code{screeplot.default} plots the variances against the number of the
principal component. This is also the \code{plot} method for classes
\code{"princomp"} and \code{"prcomp"}.
\end{Description}
\begin{Usage}
\begin{verbatim}
## Default S3 method:
screeplot(x, npcs = min(10, length(x$sdev)),
          type = c("barplot", "lines"),
          main = deparse(substitute(x)), ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] an object containing a \code{sdev} component, such as that
returned by \code{\LinkA{princomp}{princomp}()} and \code{\LinkA{prcomp}{prcomp}()}.
\item[\code{npcs}] the number of components to be plotted.
\item[\code{type}] the type of plot.
\item[\code{main, ...}] graphics parameters.
\end{ldescription}
\end{Arguments}
\begin{References}\relax
Mardia, K. V., J. T. Kent and J. M. Bibby (1979).
\emph{Multivariate Analysis}, London: Academic Press.

Venables, W. N. and B. D. Ripley (2002).
\emph{Modern Applied Statistics with S}, Springer-Verlag.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{princomp}{princomp}} and \code{\LinkA{prcomp}{prcomp}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
require(graphics)

## The variances of the variables in the
## USArrests data vary by orders of magnitude, so scaling is appropriate
(pc.cr <- princomp(USArrests, cor = TRUE))  # inappropriate
screeplot(pc.cr)

fit <- princomp(covmat=Harman74.cor)
screeplot(fit)
screeplot(fit, npcs=24, type="lines")
\end{ExampleCode}
\end{Examples}

