[Rd] rpart package, text function, and round of class counts

yindalon yinnerspace at gmail.com
Mon Mar 5 00:04:08 CET 2012

I run the following code:

fit <- rpart(Kyphosis ~ ., data=kyphosis)
text(fit, use.n=TRUE)

The text labels represent the count of each class at the leaf node.
Unfortunately, the numbers are rounded and in scientific notation rather
than the exact number of examples sorted by that node in each class. 

The plot is supposed to look like
http://www.statmethods.net/advstats/images/ctree.png as per

I'm running 2.14.1 on a mac.

Can anyone verify or point out if I am doing something obviously wrong for
displaying the counts rounded and in scientific notation rather than the
true counts in each class at each node?

View this message in context: http://r.789695.n4.nabble.com/rpart-package-text-function-and-round-of-class-counts-tp4444576p4444576.html
Sent from the R devel mailing list archive at Nabble.com.

More information about the R-devel mailing list