[R] plotting rpart objects - fancy option

Volker Bahn lochapoka at web.de
Tue Feb 27 19:24:31 CET 2007


Hi all,

I'm trying to create nice plots of rpart objects. In particular, I'd 
like to use the "fancy" option to text() that creates ellipses and 
rectangles at the splits and endnotes, respectively. This worked fine in 
the past, but now the ellipses do not interrupt the original tree lines 
anymore but overlay them (see attached ps file). I'd like it to look the 
way Figure 18 on page 49 of the rpart report "An Introduction to 
Recursive Partitioning Using the RPART Routines" looks and can't figure 
out why it doesn't.

I created the attached ps with the command:

 > post(tree)

which according to the report is pretty much equivalent to:

 > plot(tree, uniform = T, branch = 0.2, compress = T, margin = 0.1)
 > text(tree, all = T, use.n=T, fancy = T)

As for my system info:

 > sessionInfo()
R version 2.4.1 (2006-12-18)
i386-pc-mingw32

locale:
LC_COLLATE=English_Canada.1252;LC_CTYPE=English_Canada.1252;LC_MONETARY=English_Canada.1252;LC_NUMERIC=C;LC_TIME=English_Canada.1252

attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods" 
[7] "base"    

other attached packages:
   rpart
"3.1-34"


Thank you,

Volker
-------------- next part --------------
A non-text attachment was scrubbed...
Name: temptree.pr.ps
Type: application/postscript
Size: 10594 bytes
Desc: not available
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20070227/c773102b/attachment.ps 


More information about the R-help mailing list