Debian Codegraph @

man/hydrate.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/hydrate.R
3 \name{hydrate}
4 \alias{hydrate}
5 \title{Copy packages from user libraries to a project library}
6 \usage{
7 hydrate(
8 packages = NULL,
9 ...,
10 library = NULL,
11 repos = getOption("repos"),
12 update = FALSE,
13 sources = NULL,
14 prompt = interactive(),
15 report = TRUE,
16 project = NULL
17 )
18 }
19 \arguments{
20 \item{packages}{The set of \R packages to install. When \code{NULL}, the
21 packages found by \code{\link[=dependencies]{dependencies()}} are used.}
22
23 \item{...}{Unused arguments, reserved for future expansion. If any arguments
24 are matched to \code{...}, renv will signal an error.}
25
26 \item{library}{The \R library to be hydrated. When \code{NULL}, the active
27 library as reported by \code{.libPaths()} is used.}
28
29 \item{repos}{The \R repositories to be used. If the project depends on any
30 \R packages which cannot be found within the user library paths, then
31 those packages will be installed from these repositories instead.}
32
33 \item{update}{Boolean; should \code{hydrate()} attempt to update already-installed
34 packages if the requested package is already installed in the project
35 library? Set this to \code{"all"} if you'd like \emph{all} packages to be refreshed
36 from the source library if possible.}
37
38 \item{sources}{A vector of library paths where renv should look for packages.
39 When \code{NULL} (the default), \code{hydrate()} will look in the system libraries
40 (the user library, the site library and the default library) then the
41 renv cache.
42
43 If a package is not found in any of these locations, \code{hydrate()}
44 will try to install it from the active R repositories.}
45
46 \item{prompt}{Boolean; prompt the user before taking any action? Ignored
47 when \code{report = FALSE}.}
48
49 \item{report}{Boolean; display a report of what packages will be installed
50 by \code{renv::hydrate()}?}
51
52 \item{project}{The project directory. If \code{NULL}, then the active project will
53 be used. If no project is currently active, then the current working
54 directory is used instead.}
55 }
56 \value{
57 A named \R list, giving the packages that were used for hydration
58 as well as the set of packages which were not found.
59 }
60 \description{
61 \code{hydrate()} installs missing packages from a user library into the project
62 library. \code{hydrate()} is called automatically by \code{\link[=init]{init()}}, and it is rare
63 that you should need it otherwise, as it can easily get your project into
64 an inconsistent state.
65
66 It may very occasionally be useful to call \code{hydrate(update = "all")} if you
67 want to update project packages to match those installed in your global
68 library (as opposed to using \code{\link[=update]{update()}} which will get the latest versions
69 from CRAN). In this case, you should verify that your code continues to work,
70 then call \code{\link[=snapshot]{snapshot()}} to record updated package versions in the lockfile.
71 }
72 \examples{
73 \dontrun{
74
75 # hydrate the active library
76 renv::hydrate()
77
78 }
79 }
80 \keyword{internal}