Skip to content

Instantly share code, notes, and snippets.

@larsvilhuber
Last active August 24, 2017 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save larsvilhuber/d4db2e72b05a2e87e0b083f56192f6dd to your computer and use it in GitHub Desktop.
Save larsvilhuber/d4db2e72b05a2e87e0b083f56192f6dd to your computer and use it in GitHub Desktop.
Work with CRAN mirror on SDS
CRAN_base <- "file:/cac/contrib/mirror/CRAN/" # location of the local CRAN mirror - this will be different at validation!
# set CRAN base, ensuring that install.packages() can find its files
mypackages <- c("xyz","abc")
local({
r <- getOption("repos")
r["CRAN"] <- CRAN_base
options(repos = r)
})
install.packages(mypackages)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment