Skip to content

Instantly share code, notes, and snippets.

@dceoy
Last active June 17, 2018 18:04
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 dceoy/bd053f6ba3706d5e40686f6064959c89 to your computer and use it in GitHub Desktop.
Save dceoy/bd053f6ba3706d5e40686f6064959c89 to your computer and use it in GitHub Desktop.
[R] Install R packages
#!/usr/bin/env Rscript
if(length(argv <- commandArgs(trailingOnly = TRUE)) > 0) {
install.packages(pkgs = argv,
repos = c(CRAN = 'https://cran.rstudio.com/'),
dependencies = TRUE)
} else {
message('Nothig to do.')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment