Closed Aariq closed 3 years ago
Thanks for the contribution!
I think the withr
requirement to make load and read work is due to an RStudio quirk. From what I understand, if you disable in-line chunk output then the working directory for the chunk execution will become the project root directory and they will work. See: https://github.com/rstudio/rstudio/issues/2595#issuecomment-379913414
The comments relating to withr
could stay in the template, but with an added note that they apply only to RStudio users who use the inline chunk output setting.
Yeah, when tar_load()
is run in the console, or by a chunk that outputs to the console, it works. However, a naked tar_load()
also fails upon clicking the "knit" button and with rmarkdown::render()
, even with in-line chunk output disabled. I'm not sure it's this exact quirk of RStudio, but it is some RStudio weirdness. But I'm happy to clarify that the withr
wrapper is only needed in those cases.
Knit/Render not working outside of the make process could also be viewed as a feature since doing this introduces the opportunity for the Rmd output to become desynchronised with code in the repo.
For example if code had been committed, but the report knitted outside of the project pipeline using cached targets, the reproducibility receipt at the end of the report will claim the output was built against a certain commit, which would not be true.
thanks for the contribution @Aariq!
Also feel free to add yourself as 'ctb' to the DESCRIPTION file!
Makes the changes suggested in #5. I added
here
andwithr
to"Suggests"
since they are now suggested by comments in the Rmd template.