powered by
rpart
Prunes an rpart tree to have the desired number of nodes.
prune_tree(tree, maxn)
the tree to prune, an rpart object.
desired number of terminal nodes.
The pruned tree, an rpart object.