packrat-resources: Paths to Packrat Resources

packrat-resourcesR Documentation

Paths to Packrat Resources


These functions provide a mechanism for retrieving the paths to Packrat resource directories. Each of these directories can be overridden by setting either an environment variable, or an R option.


project_dir(project = NULL)

src_dir(project = NULL)

lib_dir(project = NULL)

bundles_dir(project = NULL)



The project directory.

Project Directory

project_dir() is special – the R_PACKRAT_PROJECT_DIR environment variable is set and unset by on and off, respectively, and generally should not be overridden by the user.

Directory Resolution

The following table shows the order in which resource directories are discovered (from left to right). The first non-empty result is used.

API Environment Variable R Option Default Value
project_dir() R_PACKRAT_PROJECT_DIR packrat.project.dir getwd()
src_dir() R_PACKRAT_SRC_DIR packrat.src.dir "packrat/src"
lib_dir() R_PACKRAT_LIB_DIR packrat.lib.dir "packrat/lib"
bundles_dir() R_PACKRAT_BUNDLES_DIR packrat.bundles.dir "packrat/bundles"
(none) R_PACKRAT_LIB_R_DIR packrat.lib-r.dir "packrat/lib-R"
(none) R_PACKRAT_LIB_EXT_DIR packrat.lib-ext.dir "packrat/lib-ext"

packrat documentation built on Sept. 8, 2023, 5:44 p.m.