| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/plan.R |
| 3 |
\name{plan} |
| 4 |
\alias{plan} |
| 5 |
\title{Plan package installations} |
| 6 |
\usage{ |
| 7 |
plan( |
| 8 |
packages = NULL, |
| 9 |
..., |
| 10 |
dependencies = NULL, |
| 11 |
lockfile = paths$lockfile(project = project), |
| 12 |
project = NULL |
| 13 |
) |
| 14 |
} |
| 15 |
\arguments{ |
| 16 |
\item{packages}{The packages to be included in the plan. When \code{NULL} |
| 17 |
(the default), all packages currently used in the project will be |
| 18 |
included, as determined by \code{\link[=dependencies]{dependencies()}}.} |
| 19 |
|
| 20 |
\item{...}{Unused arguments, reserved for future expansion. If any arguments |
| 21 |
are matched to \code{...}, renv will signal an error.} |
| 22 |
|
| 23 |
\item{dependencies}{A vector of DESCRIPTION field names that should be used |
| 24 |
for package dependency resolution. When \code{NULL} (the default), the value |
| 25 |
of \code{renv::settings$package.dependency.fields} is used. The aliases |
| 26 |
"strong", "most", and "all" are also supported. |
| 27 |
See \code{\link[tools:package_dependencies]{tools::package_dependencies()}} for more details.} |
| 28 |
|
| 29 |
\item{lockfile}{The path where the generated lockfile should be written. |
| 30 |
Use \code{NULL} to skip writing the lockfile.} |
| 31 |
|
| 32 |
\item{project}{The project directory. If \code{NULL}, then the active project will |
| 33 |
be used. If no project is currently active, then the current working |
| 34 |
directory is used instead.} |
| 35 |
} |
| 36 |
\value{ |
| 37 |
The generated lockfile, invisibly. |
| 38 |
} |
| 39 |
\description{ |
| 40 |
\code{renv::plan()} resolves the packages required by a project and generates |
| 41 |
a lockfile, without installing any packages. This allows you to see what |
| 42 |
\code{renv::restore()} would do before actually performing the installation. |
| 43 |
} |
| 44 |
\details{ |
| 45 |
Because packages are not installed, the generated lockfile is based on |
| 46 |
package metadata from the configured repositories (i.e. the \code{PACKAGES} |
| 47 |
file). This means the lockfile may contain only a subset of the fields |
| 48 |
that would be present in a lockfile generated by \code{\link[=snapshot]{snapshot()}}, |
| 49 |
which reads the full \code{DESCRIPTION} from installed packages. The |
| 50 |
generated lockfile is still suitable for use with \code{\link[=restore]{restore()}}. |
| 51 |
} |
| 52 |
\examples{ |
| 53 |
\dontrun{ |
| 54 |
|
| 55 |
# plan the packages required by the current project |
| 56 |
renv::plan() |
| 57 |
|
| 58 |
# plan a specific set of packages |
| 59 |
renv::plan(packages = c("dplyr", "ggplot2")) |
| 60 |
|
| 61 |
} |
| 62 |
} |