Learn R Programming

renv (version 1.0.7)

load: Load a project

Description

renv::load() sets the library paths to use a project-local library, sets up the system library sandbox, if needed, and creates shims for install.packages(), update.packages(), and remove.packages().

You should not generally need to call renv::load() yourself, as it's called automatically by the project auto-loader created by init()/ activate(). However, if needed, you can use renv::load("<project>") to explicitly load an renv project located at a particular path.

Usage

load(project = NULL, quiet = FALSE, profile = NULL, ...)

Value

The project directory, invisibly. Note that this function is normally called for its side effects.

Arguments

project

The project directory. If NULL, then the active project will be used. If no project is currently active, then the current working directory is used instead.

quiet

Boolean; be quiet during load?

profile

The profile to be activated. See vignette("profiles", package = "renv") for more information.

...

Unused arguments, reserved for future expansion. If any arguments are matched to ..., renv will signal an error.

Shims

To help you take advantage of the package cache, renv places a couple of shims on the search path:

This allows you to keep using your existing muscle memory for installing, updating, and remove packages, while taking advantage of renv features like the package cache.

If you'd like to bypass these shims within an R session, you can explicitly call the version of these functions from the utils package, e.g. with utils::install.packages(<...>).

If you'd prefer not to use the renv shims at all, they can be disabled by setting the R option options(renv.config.shims.enabled = FALSE) or by setting the environment variable RENV_CONFIG_SHIMS_ENABLED = FALSE. See ?config for more details.

Examples

Run this code
if (FALSE) {

# load a project -- note that this is normally done automatically
# by the project's auto-loader, but calling this explicitly to
# load a particular project may be useful in some circumstances
renv::load()

}

Run the code above in your browser using DataLab