% Generated by roxygen2: do not edit by hand % Please edit documentation in R/lockfiles.R \name{lockfiles} \alias{lockfiles} \alias{lockfile_create} \alias{lockfile_read} \alias{lockfile_write} \alias{lockfile_modify} \title{Lockfiles} \usage{ lockfile_create( type = settings$snapshot.type(project = project), libpaths = .libPaths(), packages = NULL, exclude = NULL, prompt = interactive(), force = FALSE, ..., project = NULL ) lockfile_read(file = NULL, ..., project = NULL) lockfile_write(lockfile, file = NULL, ..., project = NULL) lockfile_modify( lockfile = NULL, ..., remotes = NULL, repos = NULL, project = NULL ) } \arguments{ \item{type}{The type of snapshot to perform: \itemize{ \item \code{"implicit"}, (the default), uses all packages captured by \code{\link[=dependencies]{dependencies()}}. \item \code{"explicit"} uses packages recorded in \code{DESCRIPTION}. \item \code{"all"} uses all packages in the project library. \item \code{"custom"} uses a custom filter. } See \strong{Snapshot types} below for more details.} \item{libpaths}{The library paths to be used when generating the lockfile.} \item{packages}{A vector of packages to be included in the lockfile. When \code{NULL} (the default), all packages relevant for the type of snapshot being performed will be included. When set, the \code{type} argument is ignored. Recursive dependencies of the specified packages will be added to the lockfile as well.} \item{exclude}{A vector of packages to be explicitly excluded from the lockfile. Note that transitive package dependencies will always be included, to avoid potentially creating an incomplete / non-functional lockfile.} \item{prompt}{Boolean; prompt the user before taking any action? For backwards compatibility, \code{confirm} is accepted as an alias for \code{prompt}.} \item{force}{Boolean; force generation of a lockfile even when pre-flight validation checks have failed?} \item{...}{Unused arguments, reserved for future expansion. If any arguments are matched to \code{...}, renv will signal an error.} \item{project}{The project directory. If \code{NULL}, then the active project will be used. If no project is currently active, then the current working directory is used instead.} \item{file}{A file path, or \R connection.} \item{lockfile}{An \code{renv} lockfile; typically created by either \code{lockfile_create()} or \code{lockfile_read()}.} \item{remotes}{An \R vector of remote specifications.} \item{repos}{A named vector, mapping \R repository names to their URLs.} } \description{ A \strong{lockfile} records the state of a project at some point in time. } \details{ A lockfile captures the state of a project's library at some point in time. In particular, the package names, their versions, and their sources (when known) are recorded in the lockfile. Projects can be restored from a lockfile using the \code{\link[=restore]{restore()}} function. This implies reinstalling packages into the project's private library, as encoded within the lockfile. While lockfiles are normally generated and used with \code{\link[=snapshot]{snapshot()}} / \code{\link[=restore]{restore()}}, they can also be edited by hand if so desired. Lockfiles are written as \code{.json}, to allow for easy consumption by other tools. An example lockfile follows: \if{html}{\out{