-
DescriptionI usually enable caching of long running code chunks but, If I insert another code chunk before, the chunk (and the following ones) are evaluated again despite their contents have not changed. I guess that code chunks are identified by their position and thus content change is checked in a position-specific basis. Would it be possible to identify code chunks using a content hash or similar so that changing the order of chunks does not trigger their re-evaluation? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi, caching occurs differently between Jupyter and knitr, so as-is there is no concrete answer to your question. You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````qmd
---
title: "Reproducible Quarto Document"
format: html
---
This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.
```{r}
plot(cars)
```
The end.
```` |
Beta Was this translation helpful? Give feedback.
-
I close the discussion since it is a knitr behaviour and using labels serves as a workaround. |
Beta Was this translation helpful? Give feedback.
Thanks for the suggestion. I have just tried assigning a label to the code block and now caching works despite of chunks reordering, so it is also a good workaround.