From 4fc2e09a10a1c5b6996ecad39de967dfe5a75e9e Mon Sep 17 00:00:00 2001 From: Mitsuo Shiota <48662507+mitsuoxv@users.noreply.github.com> Date: Sat, 27 May 2023 04:44:25 +0900 Subject: [PATCH] avoid error (#1504) Co-authored-by: Mine Cetinkaya-Rundel --- quarto.qmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quarto.qmd b/quarto.qmd index eab1851..371484c 100644 --- a/quarto.qmd +++ b/quarto.qmd @@ -637,12 +637,12 @@ Knitr will update the results for the cached chunk whenever it detects that one Note that the chunks won't update if `a_very_large_file.csv` changes, because knitr caching only tracks changes within the `.qmd` file. If you want to also track changes to that file you can use the `cache.extra` option. This is an arbitrary R expression that will invalidate the cache whenever it changes. -A good function to use is `file.info()`: it returns a bunch of information about the file including when it was last modified. +A good function to use is `file.mtime()`: it returns when it was last modified. Then you can write: ``` {{r}} #| label: raw-data -#| cache.extra: file.info("a_very_large_file.csv") +#| cache.extra: !expr file.mtime("a_very_large_file.csv") rawdata <- readr::read_csv("a_very_large_file.csv") ```