Hello, I have done a tree in r using this command "cstree <- tree(Sales~., Carseats, subset=train)", it is working well but when I try to use the predict command like this " cstree.pred <- predict(cstree, test, type ="class")" I get this error message " Error in predict.tree(cstree, test, type = "class") : type "class" only for classification trees"
What am I doing wrong?