prune.rpart(tree, cp)
tree
|
fitted model object of class 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 rpart function.
|
cp
|
Complexity parameter to which the rpart object will be trimmed.
|
rpart
object
by recursively snipping
off the least important splits, based on the
complexity parameter (cp
).rpart
object that is trimmed to the value cp
.rpart
zp <- prune.rpart(z.auto) plot(zp) #plot smaller rpart object