Matthew Hausmann
2011-Jun-17 19:46 UTC
[Rd] Annotating a decision tree with categorical variables with a large number of categories
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
* denotes terminal node
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]]