Does using print()
give you what you're after? This prints a list of nodes in the model and then the variables at each.
rpartmodel <- rpart(Price ~ Country + Mileage + Type, data = car.test.frame)
print(rpartmodel)
Alternatively try plotting your tree using the rpart.plot package?
library(rpart.plot)
prp(rpartmodel, faclen = 9)
More customization of the plots (I find) and it labels splits with the names of categories. faclen
above controlling the number of characters shown for factor splits.