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.
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. WhenNULL
(the default), the profile is not changed. Useprofile = "default"
to revert to the defaultrenv
profile.- ...
Unused arguments, reserved for future expansion. If any arguments are matched to
...
, renv will signal an error.
Value
The project directory, invisibly. Note that this function is normally called for its side effects.
Shims
To help you take advantage of the package cache, renv places a couple of shims on the search path:
install.packages()
instead callsrenv::install()
.remove.packages()
instead callsrenv::remove()
.update.packages()
instead callsrenv::update()
.
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.