Skip to content


Some R errors explained

Post drafted in 2010, and eventually published as is because I never found time to finish it

R error messages are usually clear but also are to deal with sometimes. For instance, in Error in text.rpart(fit) : fit is not a tree, just a root the problem is crystal clear (the tree has no branch) but the fix isn’t exactly obvious… I’ll list here errors of this kind as I encounter them.

Error in plot.rpart(fitvariable) (or in text.rpart) : fit is not a tree, just a root

The tree has no branch. Apart from bad input data, it can most likely be caused by the intercept only model begin the best: rpart has decided that the best model it can find is a tree with no branches at all, which of course can’t be drawn. So the fix is: you’ll need to provide a better model to try 😉
Source: http://r.789695.n4.nabble.com/Error-in-text-rpart-fit-fit-is-not-a-tree-just-a-root-td834231.html

Posted in published drafts, statistics.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

Sorry about the CAPTCHA that requires JS. If you really don't want to enable JS and still want to comment, you can send me your comment via e-mail and I'll post it for you.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA