Debian Codegraph @

man/load.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/load.R
3 \name{load}
4 \alias{load}
5 \title{Load a project}
6 \usage{
7 load(project = NULL, quiet = FALSE, profile = NULL, ...)
8 }
9 \arguments{
10 \item{project}{The project directory. If \code{NULL}, then the active project will
11 be used. If no project is currently active, then the current working
12 directory is used instead.}
13
14 \item{quiet}{Boolean; be quiet during load?}
15
16 \item{profile}{The profile to be activated. See
17 \code{vignette("profiles", package = "renv")} for more information.
18 When \code{NULL} (the default), the profile is not changed. Use
19 \code{profile = "default"} to revert to the default \code{renv} profile.}
20
21 \item{...}{Unused arguments, reserved for future expansion. If any arguments
22 are matched to \code{...}, renv will signal an error.}
23 }
24 \value{
25 The project directory, invisibly. Note that this function is normally
26 called for its side effects.
27 }
28 \description{
29 \code{renv::load()} sets the library paths to use a project-local library,
30 sets up the system library \link{sandbox}, if needed, and creates shims
31 for \code{install.packages()}, \code{update.packages()}, and \code{remove.packages()}.
32
33 You should not generally need to call \code{renv::load()} yourself, as it's
34 called automatically by the project auto-loader created by \code{\link[=init]{init()}}/
35 \code{\link[=activate]{activate()}}. However, if needed, you can use \code{renv::load("<project>")}
36 to explicitly load an renv project located at a particular path.
37 }
38 \section{Shims}{
39 To help you take advantage of the package cache, renv places a couple of
40 shims on the search path:
41 \itemize{
42 \item \code{install.packages()} instead calls \code{renv::install()}.
43 \item \code{remove.packages()} instead calls \code{renv::remove()}.
44 \item \code{update.packages()} instead calls \code{renv::update()}.
45 }
46
47 This allows you to keep using your existing muscle memory for installing,
48 updating, and remove packages, while taking advantage of renv features
49 like the package cache.
50
51 If you'd like to bypass these shims within an \R session, you can explicitly
52 call the version of these functions from the utils package, e.g. with
53 \verb{utils::install.packages(<...>)}.
54
55 If you'd prefer not to use the renv shims at all, they can be disabled by
56 setting the R option \code{options(renv.config.shims.enabled = FALSE)} or by
57 setting the environment variable \code{RENV_CONFIG_SHIMS_ENABLED = FALSE}. See
58 \code{?config} for more details.
59 }
60
61 \examples{
62 \dontrun{
63
64 # load a project -- note that this is normally done automatically
65 # by the project's auto-loader, but calling this explicitly to
66 # load a particular project may be useful in some circumstances
67 renv::load()
68
69 }
70 }