Does R have a dependency management tool to facilitate project-specific dependencies? I\'m looking for something akin to Java\'s maven, Ruby\'s bundler, Python\'s virtualenv, No
As a stop-gap, I've written a new rbundler package. It installs project dependencies into a project-specific subdirectory (e.g.
), allowing the user to avoid using global libraries.
We've been using rbundler
at Opower for a few months now and have seen a huge improvement in developer workflow, testability, and maintainability of internal packages. Combined with our internal package repository, we have been able to stabilize development of a dozen or so packages for use in production applications.
A common workflow:
From the R console:
library(rbundler)
bundle('.')
All dependencies will be installed into ./.Rbundle
, and an .Renviron
file will be created with the following contents:
R_LIBS_USER='.Rbundle'
Any R operations run from within this project directory will adhere to the project-speciic library and package dependencies. Note that, while this method uses the package DESCRIPTION to define dependencies, it needn't have an actual package structure. Thus, rbundler
becomes a general tool for managing an R project, whether it be a simple script or a full-blown package.