Last active
November 22, 2023 15:41
-
-
Save zsusswein/fba2e72c2674f16cb2b3529cbc141bed to your computer and use it in GitHub Desktop.
Include to default to precompiled package binaries on Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set default user agent header | |
options(HTTPUserAgent = sprintf( | |
"R/%s R (%s)", | |
getRversion(), | |
paste( | |
getRversion(), | |
R.version["platform"], | |
R.version["arch"], | |
R.version["os"] | |
) | |
) | |
) | |
# Also use this user agent header for wget and curl from within R | |
options(download.file.extra = sprintf("--header \"User-Agent: R (%s)\"", | |
paste(getRversion(), | |
R.version["platform"], | |
R.version["arch"], | |
R.version["os"]) | |
) | |
) | |
UBUNTU_FLAVOR = system("grep UBUNTU_CODENAME /etc/os-release | cut -d '=' -f2", | |
intern = TRUE) | |
options(repos = c(CRAN = sprintf("https://packagemanager.rstudio.com/all/__linux__/%s/latest", | |
UBUNTU_FLAVOR | |
), | |
getOption("repos") | |
) | |
) | |
rm(UBUNTU_FLAVOR) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment