% Generated by roxygen2: do not edit by hand % Please edit documentation in R/record.R \name{record} \alias{record} \title{Update package records in a lockfile} \usage{ record(records, lockfile = NULL, project = NULL, enrich = TRUE) } \arguments{ \item{records}{A list of named records, mapping package names to a definition of their source. See \strong{Records} for more details.} \item{lockfile}{Path to a lockfile. When \code{NULL} (the default), the \code{renv.lock} located in the root of the current project will be used.} \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{enrich}{Should resolved records be enriched with the DESCRIPTION fields that \code{snapshot()} would write (\code{Depends}, \code{Imports}, \code{Suggests}, \code{LinkingTo}, \code{License}, etc.)? Defaults to \code{TRUE}. When \code{TRUE}, \code{record()} consults the active package repositories (and crandb, when enabled, for CRAN packages) to fill in the additional fields, erroring if the remote source is unreachable. The \code{Hash} field is not computed for enriched records. Additional DESCRIPTION-only fields (\code{Title}, \code{Description}, \code{Author}, \code{Maintainer}) are only included when the source can supply them -- typically when crandb is reachable for CRAN packages, or when the source is a Git host (GitHub, GitLab, Bitbucket). Set to \code{FALSE} to keep the minimal record (\code{Package}, \code{Version}, \code{Source}, \code{Repository}) produced by remote resolution.} } \description{ Use \code{record()} to record a new entry within an existing renv lockfile. } \details{ This function can be useful when you need to change one or more of the package records within an renv lockfile -- for example, because a recorded package cannot be restored in a particular environment, and you know of a suitable alternative. } \section{Records}{ Records can be provided either using the \strong{remotes} short-hand syntax, or by using an \R list of entries to record within the lockfile. See \code{?lockfiles} for more information on the structure of a package record. } \examples{ \dontrun{ # use digest 0.6.22 from package repositories -- different ways # of specifying the remote. use whichever is most natural renv::record("digest@0.6.22") renv::record(list(digest = "0.6.22")) renv::record(list(digest = "digest@0.6.22")) # alternatively, provide a full record as a list digest_record <- list( Package = "digest", Version = "0.6.22", Source = "Repository", Repository = "CRAN" ) renv::record(list(digest = digest_record)) } }