Description Usage Arguments Value Package Repositories Library See Also Examples
View source: R/restore.R View source: R/renv.R
Restore a project's dependencies from a lockfile, as previously generated by
snapshot()
.
1 2 3 4 5 6 7 8 9 10 11 |
project |
The project directory. If |
... |
Unused arguments, reserved for future expansion. If any arguments
are matched to |
library |
The library paths to be used during restore. See Library for details. |
lockfile |
The lockfile to be used for restoration of the associated
project. When |
packages |
A subset of packages recorded in the lockfile to restore.
When |
rebuild |
Force packages to be rebuilt, thereby bypassing any installed versions of the package available in the cache? This can either be a boolean (indicating that all installed packages should be rebuilt), or a vector of package names indicating which packages should be rebuilt. |
repos |
The repositories to use during restore, for packages installed
from CRAN or another similar R package repository. When set, this will
override any repositories declared in the lockfile. See also the
|
clean |
Boolean; remove packages not recorded in the lockfile from
the target library? Use |
prompt |
Boolean; prompt the user before taking any action? For backwards
compatibility, |
A named list of package records which were installed by renv
.
By default, the package repositories encoded in the lockfile will be used
during restore, as opposed to the repositories that might already
be set in the current session (through getOption("repos")
). If you'd like
to override the repositories used by renv
during restore, you can use,
for example:
1 |
See also the repos.override
option in config for an alternate way to
provide a repository override.
When renv::restore()
is called, packages from the lockfile are compared
against packages currently installed in the library paths specified by
library
. Any packages which have changed will then be installed into the
default library. If clean = TRUE
, then packages that exist within the
default library, but aren't recorded in the lockfile, will be removed as
well.
Other reproducibility:
lockfiles
,
snapshot()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ## Not run:
# disable automatic snapshots
auto.snapshot <- getOption("renv.config.auto.snapshot")
options(renv.config.auto.snapshot = FALSE)
# initialize a new project (with an empty R library)
renv::init(bare = TRUE)
# install digest 0.6.19
renv::install("digest@0.6.19")
# save library state to lockfile
renv::snapshot()
# remove digest from library
renv::remove("digest")
# check library status
renv::status()
# restore lockfile, thereby reinstalling digest 0.6.19
renv::restore()
# restore automatic snapshots
options(renv.config.auto.snapshot = auto.snapshot)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.