> 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 ______________________________________________ R-help@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.