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

From: yindalon <yinnerspace_at_gmail.com>
Date: Sun, 04 Mar 2012 15:04:08 -0800 (PST)

I run the following code:

fit <- rpart(Kyphosis ~ ., data=kyphosis) plot(fit)
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 http://www.statmethods.net/advstats/cart.html.

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.

R-devel_at_r-project.org mailing list
Received on Sun 04 Mar 2012 - 23:06:22 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 Mon 05 Mar 2012 - 08:20:24 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