Use the source!
Look at the source code here. https://github.com/yihui/knitr/blob/master/R/cache.R
You can see the mechanism is explained here (in function new_cache)
cache_output = function(hash, mode = 'character') {
get(sprintf('.%s', hash), envir = knit_global(), mode = mode, inherits = FALSE)
}
those. it is saved as an object in knit_globalenvironmentemnt`
You can check these objects on ls(knitr::knit_global(), all = TRUE)
those. 3 simple pieces below
```{r, cache=TRUE}
summary(cars)
```
```{r }
ls(knitr::knit_global(), all = TRUE)
```
```{r }
get(ls(knitr::knit_global(), all = TRUE)[1], knitr::knit_global())
```
Give the following conclusion
summary(cars)
#
#
#
#
#
#
#
ls(knitr::knit_global(), all = TRUE)
#
#
get(ls(knitr::knit_global(), all = TRUE)[1], knitr::knit_global())
#
R, *.RData load. , get cat, "\n" .