# Chapter 10 Trouble-shooting

Analogy: trying to pin the tail on the donkey, or hit a pinata blindfolded

Mine’s troubleshooting tips:

• Make sure RStudio and the rmarkdown package (and its dependencies) are up-to-date.

• Set a global option for error = TRUE (or for a given chunk) so that your document renders even when there are errors.

• Don’t try to change working directory within an R Markdown document. (If you do still decide to use setwd in a code chunk, beware that the new working directory will only apply to that specific code chunk, and any following code chunks will revert back to use the original working directory.)

Also see:

DT::datatable(devtools::session_info()\$packages)