[R] Error in text.rpart(fit) : fit is not a tree, just a root

Terry Therneau therneau at mayo.edu
Wed Nov 25 15:30:56 CET 2009


> I've tried to make a decision tree for the following data set:
....
> I don't get a tree...

 The rpart routine has decided that the best model it can find is the
"intercept only" model, i.e., a tree with no branches at all.  Stepwise
regression can have the same outcome, by the way, if no variables pass
the F-to-enter threshold.  

The plot and text routines won't plot anything for a null tree, because
there is nothing interesting to plot.

Terry Therneau




More information about the R-help mailing list