b-rodrigues/rap4all

Mention RStudio projects (.Rproj) for reproducibility

andreranza opened this issue · 2 comments

Thanks for making this OS. I have read some parts of the book, attended one of the workshops held online, and found everything in your talk helpful! One minor thing I noticed is that, as far as I am concerned, RStudio projects should be mentioned to improve reproducibility. At least for those using the RStudio IDE (maybe the majority, nowadays), this is very handy.

  • For those using RStudio, the .Rproj can be committed and not git-ignored
    • If you are using a different IDE you can act is it was not existent in the repository
  • Advantages I can think of:
    • No need to set the path in your scripts or change it in the console
    • Make R workflows portable and OS agnostics
    • Use just a relative path from your current project folder
    • Clone the repo and click on .Rproj, and you are ready to go
    • Use in combination with the {here} package
    • bonus: Robust global search within the project

Reference:

Hi Andre

happy that you’re finding the book useful! Regarding .Rproj files, I prefer discussing solutions that don’t rely on RStudio simply because a more general solution is more portable. If your project relies on RStudio to deal with paths, then other users will need to have RStudio as well. This is less portable than a solution that deals with paths in a different way, and relying on RStudio wouldn’t work inside Docker or on Github Actions, hence why I prefered not to rely on it.

I do mention Rstudio projects: https://raps-with-r.dev/prerequisites.html#essential-knowledge but again, prefer to teach without relying on it.

Thanks a lot Bruno for your answer. Please excuse me, I've somehow missed that part by searching for "project" in the repo. I see your point. I haven't use docker nor GH actions yet, so I am not able to tell how relying on .Rproj would look like in that case at the moment. Anyway, thanks a lot again for clarifying your choice and all the material made available!