When there is an error that you don’t understand, you are almost certainly making an assumption that is not true.
Check your assumptions.
Reacting to an error
When you get an error or a warning that you don’t understand, performing the following steps may help you:
- Don’t panic.
- Guess why it is happening.
- Check if your guess is correct.
- Repeat steps 1 through 3 as necessary.
The art of debugging is in the generation of the guesses and the proficiency of the checking. You get better with practice.
The state of R error messages
It has been observed that many error and warning messages in R omit important details. I’ll raise my hand to that and plead guilty. But I am trying to rehabilitate myself.
Resources
Circle 8 is a catalogue of possible errors, and begins with a brief introduction to debugging in R.
This has a chapter on how to debug and other advice on programming trouble.
Back to top level of Impatient R
jun 25, 26
Programmers think programming is really hard. Non-programmers think it’s even harder than that. Figure 1: The perceived difficulty of programming. Why is programming so arduous? […]
jun 25, 26
Coordinates: 2014 September 15-17 in the London borough of #rstats. 15th, evening I had just the right number of R bugs so that I could walk to the drinks and arrive [...]
jun 25, 26
Navigation gets you from where you are to where you want to be. Speaking of navigation, you can jump to selected sections of this post: Navigation; R-bloggers; Task views; Rdocumentation.org; [...]

