Last active
January 9, 2018 03:03
-
-
Save goddoe/7a48237e1c7a4596a4032cdeb74dd553 to your computer and use it in GitHub Desktop.
Methods to update R repository's PACKAGES file fast
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
#!/usr/bin/env bash | |
Rscript update_r_packages.R --dir "local_cran/src/contrib" |
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
#!/usr/bin/env Rscript | |
library("cranlike") | |
library("optparse") | |
# default Value | |
repos_path = "local_cran/src/contrib" | |
# Read arguments | |
option_list = list( | |
make_option(c("-d", "--dir"), type="character", default=repos_path, | |
help="path of repos", metavar="character") | |
) | |
opt_parser = OptionParser(option_list=option_list) | |
opt = parse_args(opt_parser) | |
# main | |
print("update packages...") | |
print(opt$dir) | |
update_PACKAGES(dir=opt$dir, type="source") | |
print("done") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment