\HeaderA{prune.rpart}{Cost-complexity Pruning of an Rpart Object}{prune.rpart}
\aliasA{prune}{prune.rpart}{prune}
\keyword{tree}{prune.rpart}
\begin{Description}\relax
Determines a nested sequence of subtrees of the supplied \code{rpart} object 
by recursively \code{snipping} off the least important splits, based on the 
complexity parameter (\code{cp}).
\end{Description}
\begin{Usage}
\begin{verbatim}
prune(tree, ...)

## S3 method for class 'rpart':
prune(tree, cp, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{tree}] fitted model object of class \code{rpart}.  This is assumed to be the result 
of some function that produces an object with the same named 
components as that returned by the \code{rpart} function. 

\item[\code{cp}] Complexity parameter to which the \code{rpart} object will be trimmed.

\item[\code{...}] further arguments passed to or from other methods.
\end{ldescription}
\end{Arguments}
\begin{Value}
A new \code{rpart} object that is trimmed to the value \code{cp}.
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{rpart}{rpart}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
z.auto <- rpart(Mileage ~ Weight, car.test.frame)
zp <- prune(z.auto, cp=0.1)
plot(zp) #plot smaller rpart object
\end{ExampleCode}
\end{Examples}

