I’m going to use the comment posted by @cboettig in order to resolve this question.
Packrat
Packrat is a dependency management system for R. Gives you three important advantages (all of them focused in your portability needs)
-
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.
What’s next?
-
Walkthrough guide: http://rstudio.github.io/packrat/walkthrough.html
-
Most common commands: http://rstudio.github.io/packrat/commands.html
-
Using Packrat with RStudio: http://rstudio.github.io/packrat/rstudio.html
-
Limitations and caveats: http://rstudio.github.io/packrat/limitations.html
Update: Packrat has been soft-deprecated and is now superseded by renv, so you might want to check this package instead.