[R] problem in labeling the nodes of tree drawn by rpart

kaida ning kaidaningr at gmail.com
Tue Dec 8 20:40:21 CET 2009


Hi all,

I used rpart to fit a model, where the covariates are categorical variables.
Then I plotted the tree (mytree) and used the command "text" to add labels
to the tree.

In the nodes of the tree, the values of the covariates are represented with
a, b or c (tree attached).
Is there a way to show the real value(s) of the variable in the nodes
instead of a, b or c ?
I found that the command "labels(mytree,minlength=3)" can give me the
desired label, but I don't know how to add it to the tree.


Best,
Kaida
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tree.pdf
Type: application/pdf
Size: 32968 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091208/b78abb50/attachment-0002.pdf>


More information about the R-help mailing list