Skip to content

text.rpart for the "class" method doesn't act on label="yprob"

2 messages · Robert King, Brian Ripley

#
Hello All,

Am I misreading the documentation?

The text.rpart documentation says:
"label   a column name of x$frame; values of this will label the nodes. For
the "class" method, label="yval" results in the factor levels being
used, "yprob" results in the probability of the winning factor level being
used, and ?specific yval level? results in the probability of that factor
level."

However, yprob doesn't seem to do this:
# works as advertised
Error in text.rpart(ex.rp, label = "yprob") :
        Label must be a column label of the frame component of the tree

If I try to fake it, by making an element of the frame, like this:
The text command does add text to the plot, but adds the class labels
(i.e. "yval"), not the probabilities
2 days later
#
Not sure why this on R-devel!  Nobody has contacted the maintainer, as 
asked by the posting guide.

I've wondered about this in the past.  It seems the argument was dropped 
in rpart3, but the help was not changed.  It is checked but not used.
On Wed, 21 Feb 2007, Robert King wrote: