Call snapshot()
to create a lockfile capturing the state of a project's
R package dependencies. The lockfile can be used to later restore these
project's dependencies as required. See the lockfile documentation for more
details on the structure of a lockfile.
snapshot(project = NULL, library = NULL,
lockfile = file.path(project, "renv.lock"), confirm = interactive())
The project directory. If NULL
, then the active
project will be used. If no project has been specifically activated,
the current working directory is used.
The R library to snapshot. When NULL
, the project library
associated with the requested project is used.
The location where the generated lockfile should be written.
When NULL
, the lockfile (as an R object) is returned directly instead.
Boolean; prompt the user before taking any action?
When no project library is active, snapshot()
will capture only the
packages within use (as detected by dependencies()
) within a project.