So I recently realized a maybe simpler way to deal with tar_load() not working when running chunks interactively in .Rmd files. If preferences for RStudio are set to evaluate chunks in project directory, tar_load() works fine without wrapping it in withr::with_dir(). It doesn't seem like there's a way to do that on a project-level or file level though, so maybe this should stay in the template anyways. I know I was the one that added this bit of code to the template, but I'm actually not using this anymore and I just wanted to share my new workaround.
https://github.com/MilesMcBain/tflow/blob/23be655c8d5ffd7c5bc6a7eda1cd225b618e94a1/inst/templates/blank.Rmd#L22
So I recently realized a maybe simpler way to deal with
tar_load()
not working when running chunks interactively in .Rmd files. If preferences for RStudio are set to evaluate chunks in project directory,tar_load()
works fine without wrapping it inwithr::with_dir()
. It doesn't seem like there's a way to do that on a project-level or file level though, so maybe this should stay in the template anyways. I know I was the one that added this bit of code to the template, but I'm actually not using this anymore and I just wanted to share my new workaround.