This is a very basic question on using R for classification. I'm trying to use rpart for classification task and would like to have a class label as a result, i.e. I use type="class" in predict method
predict(tree, data, type = "class")
The class labels are "0" and "1". When I try to classify a single observation I get something like this:
1 0 Levels: 0 1
As I understand this is a factor with 2 levels: 0 and 1. However, why there are 2 numbers reported and what is exactly the class assigned to this observation?