Learn R Programming

jlctree (version 0.0.2)

prune_tree: Prunes an rpart tree to have the desired number of nodes.

Description

Prunes an rpart tree to have the desired number of nodes.

Usage

prune_tree(tree, maxn)

Arguments

tree

the tree to prune, an rpart object.

maxn

desired number of terminal nodes.

Value

The pruned tree, an rpart object.