[R] rpart tree node label

Aimin Yan aiminy at iastate.edu
Wed Feb 14 23:47:05 CET 2007

 > levels(training$aa_one)
  [1] "A" "C" "D" "E" "F" "H" "I" "K" "L" "M" "N" "P" "Q" "R" "S" "T" "V" 
"W" "Y"
this is 19 levels of aa_one.

When I see tree,

in one node, it is labeled by


it is obvious that it is labeled by alphabet letter ,not by levels of aa_one.

I want to get

aa_one=CDE...... such like.

Do you know how to do this


At 04:23 PM 2/14/2007, Wensui Liu wrote:
>not sure how you want to label it.
>could you be more specific?
>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?
>>R-help at stat.math.ethz.ch mailing list
>>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

More information about the R-help mailing list