Alternatives to the packrat package - package reproducibility
Asked Answered
P

2

16

Packrat is a neat tool in theory, but for years it has been plagued by huge hang times upon starting RStudio, and the devs don't seem to be able to fix the issue. It's become unsustainable in my project. Does anybody have any good alternatives to packrat? Google searches did not turn up anything useful, so any help would be greatly appreciated.

Pimple answered 25/3, 2017 at 16:14 Comment(3)
The first alternative that comes to mind is checkpoint, though I personally think it is missing a few key features that preclude its use in many workflows. Regardless, this type of question is not appropriate for SO: it is specifically off-topic to ask for library suggestions; and there is another more appropriate stack site: Software Recs. (BTW: packrat is more about reproducibility than version control, but that's not your point.)Mcgaw
@r2evans, packrat is useful for building shiny apps but it is painful at the same time as it Increases the size of the project, initialization takes time for a new environment. Wondering if there is really a better way. I agree its off topic of SO, but where can we explore further?Shrive
Other than packrat and checkpoint, I do not know of any packages or formal methods within R to ensure point-in-time reproducibility. I have not spent nearly as much time thinking about it as both of those packages, but when doing so I could think of no way to ensure package version equivalence without significant overhead at some point. Perhaps I'm not smart or experienced enough in R (or dev in general) to do it, but ... it's difficult. It just is.Mcgaw
C
6

I'll assume you're using Packrat for reproducibility, rather than version control.

Start with the CRAN task view for reproducible research , specifically the section on Package Reproducibility. You'll find it suggests checkpoint, rbundler and packrat.

Another approach is to move from Base R to Microsoft R open. It has reproducibility built in.

Side Note: As an example use case of reproducibility, let's assume you've written some R code with packages. Then you share your research. But the package owner makes a change between the time you did the research and the time someone else is trying to reproduce your research. The change made by the package owner breaks your research. In order for someone to reproduce your research, they need to use your code WITH THE ORIGINAL PACKAGE - not the new package.

Cooperage answered 25/7, 2018 at 21:44 Comment(0)
S
6

{renv} is developed by the RStudio folks and aims to solve at least some of the problems that packrat had: https://blog.rstudio.com/2019/11/06/renv-project-environments-for-r/

"The goal then is for renv to be a robust, stable replacement for the Packrat package, with fewer surprises and better default behaviors."

Sefton answered 20/1, 2020 at 21:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.