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.
Information about the version of renv
used to manage this project.
Version | The version of the renv package used with this project. |
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. |
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. |
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.