Skip to content

Instantly share code, notes, and snippets.

@sjessa
Last active June 28, 2017 18:17
Show Gist options
  • Save sjessa/f28f12a9191eb539760d33faafe54209 to your computer and use it in GitHub Desktop.
Save sjessa/f28f12a9191eb539760d33faafe54209 to your computer and use it in GitHub Desktop.
My preferred knitr chunk settings for R Markdown documents
```{r setup, echo = FALSE, message = FALSE, warning = FALSE}
knitr::opts_chunk$set(dev = "pdf", # Save figures as PDFs
fig.keep = "all",
fig.path = "figures/", # Figures are saved to this directory
message = FALSE, # Hide messages/warnings/errors from loading packages
warning = FALSE,
error = FALSE,
cache = TRUE) # By default, cache results to avoid re-running
# super long things every time you knit
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment