Chapter 13. Debugging

image with no caption

Programmers often find that they spend more time debugging a program than actually writing it. Good debugging skills are invaluable. In this chapter, we’ll discuss debugging in R.

 

Beware of bugs in the above code; I have only proved it correct, not tried it.

 
 --Donald Knuth, pioneer of computer science

Though debugging is an art rather than a science, it involves some fundamental principles. Here, we’ll look at some debugging best practices.