From 947063746348511aa0b2403c9269978803ac20cb Mon Sep 17 00:00:00 2001 From: mine-cetinkaya-rundel Date: Fri, 26 May 2023 14:30:51 -0400 Subject: [PATCH] USe {{r}} to not evaluate but just print these chunks --- quarto.qmd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/quarto.qmd b/quarto.qmd index 260ca9b..07718fc 100644 --- a/quarto.qmd +++ b/quarto.qmd @@ -601,13 +601,13 @@ On subsequent runs, knitr will check to see if the code has changed, and if it h The caching system must be used with care, because by default it is based on the code only, not its dependencies. For example, here the `processed_data` chunk depends on the `raw-data` chunk: -```{r} +``` {{r}} #| label: raw-data rawdata <- readr::read_csv("a_very_large_file.csv") ``` -```{r} +``` {{r}} #| label: processed_data #| cache: true @@ -619,7 +619,7 @@ processed_data <- rawdata |> Caching the `processed_data` chunk means that it will get re-run if the dplyr pipeline is changed, but it won't get rerun if the `read_csv()` call changes. You can avoid that problem with the `dependson` chunk option: -```{r} +``` {{r}} #| label: processed-data #| cache: true #| dependson: "raw-data" @@ -638,7 +638,7 @@ This is an arbitrary R expression that will invalidate the cache whenever it cha A good function to use is `file.info()`: it returns a bunch of information about the file including when it was last modified. Then you can write: -```{r} +``` {{r}} #| label: raw-data #| cache.extra: file.info("a_very_large_file.csv")