[R] Re transaction list transformation to use rpart.

From: Terry Therneau <therneau_at_mayo.edu>
Date: Mon, 07 Mar 2011 08:35:03 -0600

> However the as.data.frame(a) transforms the matrix into a numeric
> data.frame so when I implement the rpart algorithm it automatically
> returns a regression classification tree.

  Look at help(rpart). The program uses the type of the y variable to GUESS at what you want for the "method" argument. It often guesses wrong. Simply add

as an argument to your call.

Terry Therneau

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Mon 07 Mar 2011 - 14:37:48 GMT

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 07 Mar 2011 - 14:40:19 GMT.

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

list of date sections of archive