Learn R Programming

renv (version 0.3.0-40)

lockfile: Lockfiles

Description

A lockfile records the state of a project at some point in time. In particular, this implies capturing the R packages installed (along with their versions) within the project's private library.

Arguments

[renv]

Information about the version of renv used to manage this project.

Version The version of the renv package used with this project.

[R]

Properties related to the version of R associated with this project.

Version The version of R used.
Repositories The R repositories used in this project.

[R/Package/*]

Package records, related to the version of an R package that was installed at the time the lockfile was generated.

Package The package name.
Version The package version.
Library The library this package was installed in.
Source The location from which this package was retrieved.
Hash (Optional) A unique hash for this package, used for package caching.

Additional remote fields, further describing how the package can be retrieved from its corresponding source, will also be included as appropriate (e.g. for packages installed from GitHub).

Details

Projects can be restored from a lockfile using the restore() function. This implies re-installing packages into the project's private library, as encoded within the lockfile.

While lockfiles are normally generated and used with snapshot() / restore(), they can also hand-edited if so desired. The structure is similar to that of the Windows-style .ini file, with some provisioning for nested sections.

An example lockfile follows:

[renv]
Version=0.1.0

[R] Version=3.5.1 Repositories= CRAN=https://cran.rstudio.com

[R/Package/markdown] Package=markdown Version=0.9 Source=CRAN Hash=8515151150d7372bc76e0af15ef5dee0

[R/Package/mime] Package=mime Version=0.6 Source=CRAN Hash=b1e49df8aef896bc8c0b749ef1da5a48

The sections used within a lockfile are described next.

See Also

Other reproducibility: restore, snapshot