forked from magpiemodel/magpie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rprofile
34 lines (29 loc) · 1.34 KB
/
.Rprofile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# | (C) 2008-2023 Potsdam Institute for Climate Impact Research (PIK)
# | authors, and contributors see CITATION.cff file. This file is part
# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of
# | AGPL-3.0, you are granted additional permissions described in the
# | MAgPIE License Exception, version 1.0 (see LICENSE file).
# | Contact: [email protected]
Sys.setenv(RENV_PATHS_LIBRARY = "renv/library")
source("renv/activate.R")
renvVersion <- "0.16.0"
if (packageVersion("renv") != renvVersion) {
renvLockExisted <- file.exists(renv::paths$lockfile())
renv::upgrade(version = renvVersion, reload = TRUE, prompt = FALSE)
if (!renvLockExisted) {
unlink(renv::paths$lockfile())
}
}
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() # auto-detect and install all dependencies
message("Finished installing R package dependencies.")
}
# source global .Rprofile (very important to load user specific settings)
if (file.exists("~/.Rprofile")) {
source("~/.Rprofile")
}