[R] How to draw a tree?

Uwe Ligges ligges at statistik.uni-dortmund.de
Thu Apr 8 19:58:24 CEST 2004


Christian Hennig wrote:

> Hi,
> 
> I have run rpart to construct a regression tree. Is there any simple
> method to draw a nice picture of it, as it is usually done in books and
> paper to visualize the tree?
> 
> Thank you,
> Christian
> 
> ***********************************************************************
> Christian Hennig
> Fachbereich Mathematik-SPST/ZMS, Universitaet Hamburg
> hennig at math.uni-hamburg.de, http://www.math.uni-hamburg.de/home/hennig/
> #######################################################################
> ich empfehle www.boag-online.de
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Christian,

rpobj <- rpart(....)
plot(rpobj)
text(rpobj)

See ?plot.rpart and ?text.rpart for details on how to tune the 
visualization.

Uwe




More information about the R-help mailing list