3
votes

I am creating some decision trees using the package rpart in R. I have discrete variables like age, no.of.children in my dataset. But the resulting decision tree has these variables n decimals. Which means, it is considered as continuous variables.

How to avoid this and how can i get these variables as discrete in my decision tree?

1

1 Answers

2
votes

Make them into factors, the standard way to represent discrete variables in R.