[codeface] Packrat - Reproducible package management for R

  • From: Claus Hunsen <hunsen@xxxxxxxxxxxxxxxxx>
  • To: codeface <codeface@xxxxxxxxxxxxx>
  • Date: Tue, 05 Aug 2014 12:48:09 +0200

Hi all,

I remember discussing the matter of package and dependency management for codeface while Mitchell was here in Passau. The mailing list analysis broke due to a new version of the tm package, as I remember right, and we discussed that it would be great to deploy only working packages to the users of codeface. Coincidentally, I found a possible (partial) solution for this management on the RStudio blog [1] just yesterday evening: Packrat from http://rstudio.github.io/packrat/.

Packrat is a dependency management system for R.

R package dependencies can be frustrating. Have you ever had to use
trial-and-error to figure out what R packages you need to install to make
someone else’s code work–and then been left with those packages globally
installed forever, because now you’re not sure whether you need them? Have you
ever updated a package to get code in one of your projects to work, only to
find that the updated package makes code in another project stop working?

We built packrat to solve these problems. Use packrat to make your R
projects more:
# Isolated: Installing a new or updated package for one project won’t
break your other projects, and vice versa. That’s because packrat gives
each project its own private package library.
# Portable: Easily transport your projects from one computer to
another, even across different platforms. Packrat makes it easy to
install the packages your project depends on.
# Reproducible: Packrat records the exact package versions you depend
on, and ensures those exact versions are the ones that get installed
wherever you go.

Just to sketch my idea:
The maintainers of codeface provide a Packrat dependency configuration though the GitHub repository that is automatically used by all users of codeface. This way, everybody uses a working package installation of R in order to run codeface. If and when package updates are tested by a maintainer, the configuration can be updated and pushed to the repository, so that any user is able to update safely and in a managed way.

I don't really know if this fully works out with Packrat due to its limitations [2], but it's certainly worth a shot. Can anybody who is more familiar to codeface and R have a look on this, if Packrat is useful for the project?

Thanks in advance and kind regards,
Claus


[1] http://blog.rstudio.org/2014/07/22/announcing-packrat-v0-4/
[2] http://rstudio.github.io/packrat/limitations.html

Other related posts: