I understand that I can use the cache=TRUE
option to cache an R code chunk using R Markdown with knitr
. E.g., It might look something like this:
```{r longanalysis, cache=TRUE}
for (i in 1:5000) {
lm((i+1)~i)
}
```
And I realise that If I wanted to disable the cache for that analysis that I could change the option to cache=FALSE
in the code chunk. However, if I have many R code chunks with caching enabled, this would require a careful find and replace operation.
Question
- Is there a way of temporarily setting
cache=FALSE
for an entire R Markdown document?
Comments
I've seen this example where the first line is. So I imagine this is a way of setting global setting, but I think local settings override global settings.
`r opts_chunk$set(fig.width=5, fig.height=5, fig.path='')`