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 is currently active, then the current working
directory is used instead.
Optional arguments; reserved for future expansion.
The R library to snapshot. When NULL, the active R
libraries (as reported by .libPaths()) are used.
The location where the generated lockfile should be written.
By default, the lockfile is written to a file called renv.lock in the
project directory. 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.