This function is provided for backward compatibility
with old versions of rpart.plot
(prior to version 2.0.0, June 2016).
By default this function creates a minimal unadorned plot, whereas
rpart.plot creates a colored plot automatically tailored to the
model's type.
Actually, the only difference between the two functions is that some
arguments have different defaults.
This function has the same defaults as prp.
See the rpart.plot help page for a table showing the
different defaults.
Functions in the rpart package:
plot.rparttext.rpartrpart
Examples
data(ptitanic)
tree <- rpart(survived ~ ., data=ptitanic, cp=.02)
# cp=.02 because want small tree for demo
old.par <- par(mfrow=c(2,2))
# put 4 figures on one page
rpart.plot.version1(tree, main="default rpart.plot.version1\n(type = 0, extra = 0)")
rpart.plot.version1(tree, main="type = 4, extra = 6",
type=4, extra=6, faclen=0) # faclen=0 to print full factor names
rpart.plot.version1(tree, main="extra = 106, under = TRUE",
extra=106, under=TRUE, faclen=0)
# compare to the plotting functions in the rpart package
plot(tree, uniform=TRUE, compress=TRUE, branch=.2)
text(tree, use.n=TRUE, cex=.8, xpd=NA) # cex is a guess, depends on your window size
title("compare to the plotting functions\nin the rpart package", cex.sub=.8)
par(old.par)