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
See ?post.rpart. That's probably as good as it'll get. You might also want to look at the maptree package on CRAN. HTH, Andy> From: Christian Hennig > > 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 > >------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments,...{{dropped}}
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.htmlChristian, rpobj <- rpart(....) plot(rpobj) text(rpobj) See ?plot.rpart and ?text.rpart for details on how to tune the visualization. Uwe