> 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