## dataset not in R
## same as rpart:
## Not run:
# z.survey <- itree(market.survey) #grow the itree object
# plot(z.survey) #plot the tree
# z.survey2 <- snip.itree(z.survey,toss=2) #trim subtree at node 2
# plot(z.survey2) #plot new tree
#
# # can also interactively select the node using the mouse in the
# # graphics window
#
# ## End(Not run)
#works with itree fits as well:
z.auto <- itree(Mileage ~ Weight, method="purity",car.test.frame)
#snip off the long branch:
z.auto2 <- snip.itree(z.auto,toss=3)
Run the code above in your browser using DataLab