Learn R Programming

renv (version 0.3.0-40)

snapshot: Snapshot a Project

Description

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.

Usage

snapshot(project = NULL, library = NULL,
  lockfile = file.path(project, "renv.lock"), confirm = interactive())

Arguments

project

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.

library

The R library to snapshot. When NULL, the project library associated with the requested project is used.

lockfile

The location where the generated lockfile should be written. When NULL, the lockfile (as an R object) is returned directly instead.

confirm

Boolean; prompt the user before taking any action?

Details

When no project library is active, snapshot() will capture only the packages within use (as detected by dependencies()) within a project.

See Also

Other reproducibility: lockfile, restore