-
Notifications
You must be signed in to change notification settings - Fork 1
/
.Rprofile
31 lines (27 loc) · 1.01 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
## set CRAN repos; use binary linux packages if on Ubuntu
local({
options(Ncpus = parallel::detectCores() / 2)
options("repos" = c(CRAN = "https://cran.rstudio.com"))
if (Sys.info()["sysname"] == "Linux" && grepl("Ubuntu", utils::osVersion)) {
.os.version <- strsplit(system("lsb_release -c", intern = TRUE), ":\t")[[1]][[2]]
.user.agent <- paste0(
"R/", getRversion(), " R (",
paste(getRversion(), R.version["platform"], R.version["arch"], R.version["os"]),
")"
)
options(repos = c(CRAN = paste0("https://packagemanager.rstudio.com/all/__linux__/",
.os.version, "/latest")))
options(HTTPUserAgent = .user.agent)
}
})
topLevelPkgDir <- if (Sys.info()[["user"]] == "emcintir") {
"../packages_MPB_SK"
} else {
"packages"
}
pkgDir <- file.path(topLevelPkgDir, version$platform,
paste0(version$major, ".", strsplit(version$minor, "[.]")[[1]][1]))
if (!dir.exists(pkgDir)) {
dir.create(pkgDir, recursive = TRUE)
}
.libPaths(pkgDir)