MilesMcBain / tflow

An opinionated lightweight template for smooth targets flows.
Other
90 stars 9 forks source link

`withr::with_dir()` not necessary if 'evaluate chunks in project directory' option set #19

Open Aariq opened 2 years ago

Aariq commented 2 years ago

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 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.

Aariq commented 2 years ago

Screen Shot 2022-02-11 at 10 50 16 AM

Aariq commented 2 years ago

followup to #5