load {renv} | R Documentation |
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, ...)
Arguments
project |
The project directory. If |
quiet |
Boolean; be quiet during load? |
profile |
The profile to be activated. See
|
... |
Unused arguments, reserved for future expansion. If any arguments
are matched to |
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.
Examples
## Not run:
# 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()
## End(Not run)