rpart
object.post.rpart(tree, title.,
filename=paste(deparse(substitute(tree)), ".ps", sep = ""),
digits= .Options$digits -3, pretty=TRUE,
use.n=T, horizontal=TRUE, ...)
rpart
. This is assumed to be the result
of some function that produces an object with the same named
components as that returned by the rpart
function.rpart
endpoint is printed out.rpart
(with the suffix .ps
added). If
filename = ""
, the plot appears on the current graphical device.NULL
signifies using
elements of letters to represent the different factor TRUE
(default), adds to label
(#events level1/ #events level2/etc. for method class
, n
for
method anova
, and #events/n for methods poisson
and exp
).TRUE
(default), plot is horizontal. If FALSE
, plot
appears as landscape.postscript
function.rpart
is created using the postscript
driver.plot.rpart
and text.rpart
(with
the fancy
option). The settings were chosen because they looked
good to us, but other options may be better, depending on the rpart
object.
Users are encouraged to write their own function containing favorite
options.plot.rpart
, rpart
, text.rpart
, abbreviate
data(car.test.frame)
z.auto <- rpart(Mileage ~ Weight, car.test.frame)
post(z.auto, file="") # display tree on active device
# now construct postscript version on file "pretty"
# with no title
post(z.auto, file="pretty", title="")
z.hp <- rpart(Mileage ~ Weight + HP, car.test.frame)
post(z.hp)
Run the code above in your browser using DataLab