Learn R Programming

renv (version 0.6.0-73)

restore: Restore a Project

Description

Restore a project's dependencies from a lockfile, as previously generated by snapshot().

Usage

restore(project = NULL, ..., library = NULL, lockfile = NULL,
  clean = FALSE, confirm = interactive())

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.

...

Optional arguments; reserved for future expansion.

library

The path to the library in which packages will be restored. When NULL, the project library is used.

lockfile

The lockfile to be used for restoration of the associated project. When NULL, the most recently generated lockfile for this project is used.

clean

Boolean; remove packages not recorded in the lockfile from the target library? Use clean = TRUE if you'd like the library state to exactly reflect the lockfile contents after restore().

confirm

Boolean; prompt the user before taking any action?

See Also

Other reproducibility: lockfile, snapshot

Examples

Run this code
# 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)

# }

Run the code above in your browser using DataLab