[Rd] Annotating a decision tree with categorical variables with a large number of categories

From: Matthew Hausmann <matthew.p.hausmann_at_gmail.com>
Date: Fri, 17 Jun 2011 14:46:26 -0500


I have a decision tree I generated using the tree class. When I call text.tree, if the tree is split on a categorical variable, the text over the split says, for instance, "variable:afn," if the split occurs on the 1st, 6th, and 14th levels of the variable. Unfortunately, if the tree splits over a categorical variable with more categories than easily printable characters, I get this error:

node), split, n, deviance, yval

Error in sub("^<", " < ", frame$splits) :   input string 1 is invalid in this locale

If anyone else has had this problem and successfully worked around it, what did you do? Ideally, instead of "variable:afn" I'd like something to the effect of "variable=1,6,14."
Thanks!

        [[alternative HTML version deleted]]



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 17 Jun 2011 - 19:52:24 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 19 Jun 2011 - 18:30:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive