Debian Codegraph @

man/sandbox.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/sandbox.R
3 \docType{data}
4 \name{sandbox}
5 \alias{sandbox}
6 \title{The default library sandbox}
7 \usage{
8 sandbox
9 }
10 \description{
11 An \R installation can have up to three types of library paths available
12 to the user:
13 \itemize{
14 \item The \emph{user library}, where \R packages downloaded and installed by the
15 current user are installed. This library path is only visible to that
16 specific user.
17 \item The \emph{site library}, where \R packages maintained by administrators of a
18 system are installed. This library path, if it exists, is visible to all
19 users on the system.
20 \item The \emph{default library}, where \R packages distributed with \R itself are
21 installed. This library path is visible to all users on the system.
22 }
23
24 Normally, only so-called "base" and "recommended" packages should be installed
25 in the default library. (You can get a list of these packages with
26 \code{installed.packages(priority = c("base", "recommended"))}). However, it is
27 possible for users and administrators to install packages into the default
28 library, if the filesystem permissions permit them to do so. (This, for
29 example, is the default behavior on macOS.)
30
31 Because the site and default libraries are visible to all users, having those
32 accessible in renv projects can potentially break isolation -- that is,
33 if a package were updated in the default library, that update would be visible
34 to all \R projects on the system.
35
36 To help defend against this, renv uses something called the "sandbox" to
37 isolate renv projects from non-"base" packages that are installed into the
38 default library. When an renv project is loaded, renv will:
39 \itemize{
40 \item Create a new, empty library path (called the "sandbox"),
41 \item Link only the "base" and "recommended" packages from the default library
42 into the sandbox,
43 \item Mark the sandbox as read-only, so that users are unable to install packages
44 into this library,
45 \item Instruct the \R session to use the "sandbox" as the default library.
46 }
47
48 This process is mostly transparent to the user. However, because the sandbox
49 is read-only, if you later need to remove the sandbox, you'll need to reset
50 file permissions manually; for example, with \code{renv::sandbox$unlock()}.
51
52 If you'd prefer to keep the sandbox unlocked, you can also set:
53
54 \if{html}{\out{<div class="sourceCode">}}\preformatted{RENV_SANDBOX_LOCKING_ENABLED = FALSE
55 }\if{html}{\out{</div>}}
56
57 in an appropriate startup \code{.Renviron} or \code{Renviron.site} file.
58
59 The sandbox can also be disabled entirely with:
60
61 \if{html}{\out{<div class="sourceCode">}}\preformatted{RENV_CONFIG_SANDBOX_ENABLED = FALSE
62 }\if{html}{\out{</div>}}
63
64 The sandbox library path can also be configured using the \code{RENV_PATHS_SANDBOX}
65 environment variable: see \link{paths} for more details.
66 }
67 \keyword{datasets}