[R] Re transaction list transformation to use rpart.

Terry Therneau therneau at mayo.edu
Mon Mar 7 15:35:03 CET 2011


> 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 
   method="class"
as an argument to your call.

Terry Therneau



More information about the R-help mailing list