Packrat commands

View the Project on GitHub rstudio/packrat

The following is a list of the R functions in the packrat package that you’ll use most often. You can find more detailed documentation by typing help(package="packrat") at the R console.

For more background on how these commands fit into the packrat workflow, see the walkthrough.

Main Functionality

When you want to manage the state of your private library, you can use the Packrat functions:

Share a Packrat project with bundle and unbundle:

Navigate projects with:


Packrat project-specific options can be accessed and set with:

The current set of available options is:


Perform automatic, asynchronous snapshots when running interactively? (TRUE / FALSE; defaults to TRUE)


Install packages into a global cache, which is then shared across projects? By default, an OS-specific application data directory is used, but this can be overridden with the R_PACKRAT_CACHE_DIR environment variable.


Print the banner on startup? Can be one of TRUE (always print), FALSE (never print), and ‘auto` (do the right thing).


Add the packrat private library to your version control system ignore? (TRUE / FALSE; defaults to TRUE)


Add the packrat private sources to your version control system ignore? (TRUE / FALSE; defaults to FALSE)


Packages which should be loaded from the user library upon entering packrat mode. This can be useful for very large packages which you don’t want duplicated across multiple projects, e.g. Bioconductor annotation packages.


Local ‘repositories’; i.e., directories containing package sources either as folders or as package tarballs. (Character vector; empty by default)


There are also utility functions for using and managing packages in the external / user library, and can be useful for leveraging packages in the user library that you might not want as project-specific dependencies, e.g. devtools, knitr, roxygen2: