DRAFT :: Caching with knitr and Rmarkdown

· by Mikey Harper · Read in about 1 min · (150 words) ·

R Markdown is fantastic tool to

Caching

It can slow things does if these have to run large computations within your analysis. For example, you may have a

Invalidating Cache

One limitation which can create problems with caching is that it is

https://stackoverflow.com/q/18376008/7347699

As an example, if we have the basic R Markdown file

---
output: pdf_document
---

``{r}
z <- "Title 5"
y <- "Some Text"
x <- "x2"
```


``{r cars2, cache = TRUE, cache.whatever= list(x, y, z)}
plot(cars, main = z, xlab = x, ylab = y)
```
---
output: pdf_document
---

``{r}
z <- "Title 5"
y <- "Some Text"
x <- "x2"
```


``{r cars2, cache = TRUE, cache.whatever= list(x, y, z)}
plot(cars, main = z, xlab = x, ylab = y)
```
z <- "Title 5"
y <- "Some Text"
x <- "x2"

``

plot(cars, main = z, xlab = x, ylab = y)