-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRprofile
31 lines (25 loc) · 1.17 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
# Based on Jeroen's config:
# https://github.com/r-universe-org/base-image/blob/f20ec9fc6f51ef8a89aad489206a43790bd9bf77/Rprofile
local({
rver <- getRversion()
distro <- system2('lsb_release', '-sc', stdout = TRUE)
options(HTTPUserAgent = sprintf("R/%s R (%s)", rver, paste(rver, R.version$platform, R.version$arch, R.version$os)))
options(repos = c(CRAN = sprintf("https://packagemanager.rstudio.com/all/__linux__/%s/latest", distro)))
# Enable BioConductor repos
utils::setRepositories(ind = 1:4, addURLs = c(fallback = "https://cloud.r-project.org"))
# Enable universe repo(s)
my_universe <- Sys.getenv("MY_UNIVERSE", "https://cran.r-universe.dev")
if(nchar(my_universe)){
my_repos <- trimws(strsplit(my_universe, ';')[[1]])
binaries <- sprintf('%s/bin/linux/%s/%s', my_repos[1], distro, substr(rver, 1, 3))
options(repos = c(binaries = binaries, universe = my_repos, getOption("repos")))
}
# Other settings
options(crayon.enabled = TRUE)
Sys.unsetenv(c("CI", "GITHUB_ACTIONS"))
# Dummy token for API limits
if(is.na(Sys.getenv("GITHUB_PAT", NA))){
dummy <- c('ghp_SXg', 'LNM', 'Tu4cnal', 'tdqkZtBojc3s563G', 'iqv')
Sys.setenv(GITHUB_PAT = paste(dummy, collapse = 'e'))
}
})