0
votes

Is it possible to graph the decision tree for more than 3 levels in R?

I used rpart.plot to graph it and 2 of my target value levels were not displayed.

I have entered my coding that way. How would I modify it to plot 5 layers and which package must I add?

fit <- rpart (Range~., data =x_test, method = 'class') 
rpart.plot(fit, type=5,extra = 106) 
1
See here on making an R question that folks can help with. That includes a sample of data, all necessary code, and a clear explanation of what you're trying to do and what hasn't worked.camille

1 Answers

0
votes

The argument: snip, is set to false by default. Set it to true, to interactively trim the tree with the mouse.