quarto-dev / quarto-dev/quarto-cli
Provide examples of chunk cache invalidation
@cderv is already working on this.
Since Sep 23, 2022.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
I've been trying to get code chunk cache invalidation to work based on a global variable (which will eventually be a string with a digest hash of several my data set. For now, I would be content with the following.
In code chunk 1, I set my_variable:
my_variable <- "a"
Then in code chunk B, I do a plot, that gets cached, unless I change the value of my_variable in code chunk 1:
#| cache: true
#| cache-vars: my_variable
#| cache-globals: my_variable
#| autodep: true
ggplot(...)
I've been trying around various combination of the chunk settings using the new Quarto syntax. But none of the combinations seems to trigger a refresh of the cached chunk.
An immediate solution would be to have an example here, but even better would be if the documentation (for example at https://quarto.org/docs/reference/cells/cells-knitr.html#cache ) could be a bit clearer on how to achieve this.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.