-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path.Rprofile
More file actions
24 lines (19 loc) · 1.12 KB
/
.Rprofile
File metadata and controls
24 lines (19 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# setting RENV_PATHS_LIBRARY ensures packages are installed into renv/library
# for some reason this also has implications for symlinking into the global cache
Sys.setenv(RENV_PATHS_LIBRARY = "renv/library")
# do not check if library and renv.lock are in sync, because normally renv.lock does not exist
options(renv.config.synchronized.check = FALSE)
source("renv/activate.R")
if (!"https://rse.pik-potsdam.de/r/packages" %in% getOption("repos")) {
options(repos = c(getOption("repos"), pik = "https://rse.pik-potsdam.de/r/packages"))
}
# bootstrapping, will only run once after this repo is freshly cloned
if (isTRUE(rownames(installed.packages(priority = "NA")) == "renv")) {
message("R package dependencies are not installed in this renv, installing now...")
renv::hydrate(prompt = FALSE, report = FALSE) # auto-detect and install all dependencies
message("Finished installing R package dependencies.")
}
# in case bootstrapping fails halfway, install piamenv and rely on requirement auto-fixing
if (tryCatch(utils::packageVersion("piamenv") < "0.5.5", error = function(error) TRUE)) {
renv::install("piamenv", prompt = FALSE)
}