Created
April 25, 2017 21:00
-
-
Save zkamvar/4c587737aeb1ff35021c89c456f7ceda to your computer and use it in GitHub Desktop.
Script for updating CRAN packages
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
# Note: this assumes that you have a custom library at the top of your .libPaths() | |
fields <- c("Package", "LibPath", "Version", "Priority", "Depends", "Imports", "LinkingTo", "Suggests", "Enhances", "OS_type", "Built", "RemoteSha", "Packaged", "biocViews") | |
x <- installed.packages(.libPaths()[1], fields = fields) | |
needs_update <- x[x[, "Built"] != "3.4.0", ] | |
bicond <- !is.na(needs_update[, "biocViews"]) | |
ghub <- !is.na(needs_update[, "RemoteSha"]) | |
remote <- !is.na(needs_update[, "Packaged"]) | |
bioconductor <- needs_update[bicond, ] | |
cran <- needs_update[!bicond & !ghub & remote, ] | |
install.packages(rownames(cran)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually, just use
https://twitter.com/ucfagls/status/856978295358799873