rpart.plot.version1.Rd
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.
rpart.plot.version1(x = stop("no 'x' arg"), type = 0, extra = 0, under = FALSE, fallen.leaves = FALSE, digits = 2, varlen = -8, faclen = 3, cex = NULL, tweak = 1, snip = FALSE, box.palette = 0, shadow.col = 0, ...)
x | Same as |
---|---|
type | Default |
extra | Default |
under | Default |
fallen.leaves | Default |
digits | Default |
varlen | Default |
faclen | Default |
cex | Default |
tweak | Default |
snip | Default |
box.palette | Default |
shadow.col | Default |
... | Same as |
The returned value is identical to that of prp
.
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)par(old.par)