I’m thinking of reigning in a collaborative/GitHub #rstats project to have a reproducible environment: Would you recommend renv or rix for this? Project utilises a mixture of GitHub / CRAN packages & users have different OSes (Mac/Win).
Comments
Log in with your Bluesky account to leave a comment
Overall I’m very happy with rix/nix and am currently using it with two projects. The projects rely on R and non-R depend like pandoc, cmdstan, git, and runs them seamlessly. I am also using an apaquarto template to generate the manuscript to different formats like typst (pdf) and word
I was trying to use renv and we all ran into issues trying to get our environments to run the repo seamlessly. We had to make compromises. With rix I don’t feel like I have to compromises with my data.
The project you described, with users having different OS, might call for {rix}, which provides an entire ecosystem snapshot, including system-level dependencie, whereas {renv} only snapshots package versions.
I’ve set up a GitHub repo with GitHub actions with the help of @brodriguesco.bsky.social that will build the entire project on Linux (I use Mac) and push changes to the repo after it’s built (manuscript/figures/data). It is awesome. When I imagine computational reproducibility this is it.
I’ve used both renv and rix, but only on linux. renv comes at nearly zero cost, but as said before only snapshots package versions. I am always annoyed with chaning R versions (using rig) when switching between projects and updates to system libraries sometimes break packages (e.g. stringi).
In fact, renv has to be combined with docker, which is then very reproducible and safe, but it takes some time to build and rebuild the image (can take very long with renv downloading and installing each package every time).
Rix comes at slightly higher costs (although thanks to recent updates really only slightly), but then your reproducible environment is done. Thanks to caching, this is quite fast, and if you then add a package, rebuilding with nix (using local caches) is super fast.
What i plan for future project: use rix from the start with a fixed date. If it's not working, I can still switch to renv + docker at any time with zero costs (while swicthing from renv to nix is not that safe despite renv2nix because of inaccurate version matching)
Comments