Closed Aariq closed 3 years ago
Possibly by adding a code chunk with something like:
```{r load-data}
withr::with_dir(here::here(), {
## Load targets with tar_load() here only
# tar_load(target1)
# tar_load(target2)
})
Ah, nevermind. I think maybe there is a different problem going on. I'll close this for now until I figure it out.
If an .Rmd file inside a directory (like the default for
use_rmd("analysis")
hastar_load()
in it, I get the following error:This happens when knitting, running chunks, or running
tar_render("doc/analysis.Rmd")
, even thoughtar_load()
works in the console.Reproducible code and workarounds here: https://github.com/ropensci/targets/issues/230
For what it's worth, only one of the workarounds in that issue actually worked for me:
It would be useful if the .Rmd created by
use_rmd()
implemented one of these workarounds sotar_load()
could work.