% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plan.R
\name{plan}
\alias{plan}
\title{Plan package installations}
\usage{
plan(
  packages = NULL,
  ...,
  dependencies = NULL,
  lockfile = paths$lockfile(project = project),
  project = NULL
)
}
\arguments{
\item{packages}{The packages to be included in the plan. When \code{NULL}
(the default), all packages currently used in the project will be
included, as determined by \code{\link[=dependencies]{dependencies()}}.}

\item{...}{Unused arguments, reserved for future expansion. If any arguments
are matched to \code{...}, renv will signal an error.}

\item{dependencies}{A vector of DESCRIPTION field names that should be used
for package dependency resolution. When \code{NULL} (the default), the value
of \code{renv::settings$package.dependency.fields} is used. The aliases
"strong", "most", and "all" are also supported.
See \code{\link[tools:package_dependencies]{tools::package_dependencies()}} for more details.}

\item{lockfile}{The path where the generated lockfile should be written.
Use \code{NULL} to skip writing the lockfile.}

\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.}
}
\value{
The generated lockfile, invisibly.
}
\description{
\code{renv::plan()} resolves the packages required by a project and generates
a lockfile, without installing any packages. This allows you to see what
\code{renv::restore()} would do before actually performing the installation.
}
\details{
Because packages are not installed, the generated lockfile is based on
package metadata from the configured repositories (i.e. the \code{PACKAGES}
file). This means the lockfile may contain only a subset of the fields
that would be present in a lockfile generated by \code{\link[=snapshot]{snapshot()}},
which reads the full \code{DESCRIPTION} from installed packages. The
generated lockfile is still suitable for use with \code{\link[=restore]{restore()}}.
}
\examples{
\dontrun{

# plan the packages required by the current project
renv::plan()

# plan a specific set of packages
renv::plan(packages = c("dplyr", "ggplot2"))

}
}
