\HeaderA{plotcp}{Plot a Complexity Parameter Table for an Rpart Fit}{plotcp}
\keyword{tree}{plotcp}
\begin{Description}\relax
Gives a visual representation of the cross-validation results in an 
\code{rpart} object.
\end{Description}
\begin{Usage}
\begin{verbatim}
plotcp(x, minline = TRUE, lty = 3, col = 1,
       upper = c("size", "splits", "none"), ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] an object of class \code{rpart} 

\item[\code{minline}] whether a horizontal line is drawn 1SE above the minimum of the curve. 

\item[\code{lty}] line type for this line 

\item[\code{col}] colour for this line 

\item[\code{upper}] what is plotted on the top axis: the size of the tree (the number of
leaves), the number of splits or nothing. 

\item[\code{...}] additional plotting parameters 

\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The set of possible cost-complexity prunings of a tree from a nested
set. For the geometric means of the intervals of values of \code{cp} for which
a pruning is optimal, a cross-validation has (usually) been done in
the initial construction by \code{\LinkA{rpart}{rpart}}. The \code{cptable} in the fit contains
the mean and standard deviation of the errors in the cross-validated
prediction against each of the geometric means, and these are plotted
by this function. A good choice of \code{cp} for pruning is often the
leftmost value for which the mean lies below the horizontal line.
\end{Details}
\begin{Value}
None.
\end{Value}
\begin{Section}{Side Effects}
A plot is produced on the current graphical device.
\end{Section}
\begin{SeeAlso}\relax
\code{\LinkA{rpart}{rpart}},  \code{\LinkA{printcp}{printcp}},  \code{\LinkA{rpart.object}{rpart.object}}
\end{SeeAlso}

