[R] rpart tree node label [Broadcast]

Liaw, Andy andy_liaw at merck.com
Wed Feb 14 23:49:09 CET 2007


Try the following to see:

library(rpart)
iris.rp(Sepal.Length ~ Species, iris)
plot(iris.rp)
text(iris.rp)

Two possible solutions:

1. Use text(..., pretty=0).  See ?text.rpart.
2. Use post(..., filename="").

Andy 

From: Wensui Liu
> 
> not sure how you want to label it.
> could you be more specific?
> thanks.
> 
> On 2/14/07, Aimin Yan <aiminy at iastate.edu> wrote:
> > I generate a tree use rpart.
> > In the node of tree, split is based on the some factor.
> > I want to label these node based on the levels of this factor.
> >
> > Does anyone know how to do this?
> >
> > Thanks,
> >
> > Aimin
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide 
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
> 
> 
> --
> WenSui Liu
> A lousy statistician who happens to know a little programming
> (http://spaces.msn.com/statcompute/blog)
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 
> 


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments,...{{dropped}}



More information about the R-help mailing list