Last active
May 3, 2018 02:10
-
-
Save dongzhuoer/dd332dc13ef06ee4447f69aaacbdcb1a to your computer and use it in GitHub Desktop.
This script is used before `update.packages(ask = F)` on Travis CI R
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
if (Sys.getenv('TRAVIS_OS_NAME') == 'linux') { | |
installed <- installed.packages() | |
recommended <- installed[mapply(identical, installed[ ,"Priority"], 'recommended'), 'Package'] | |
lapply(recommended, function(pkg){ | |
src = file.path(.Library, pkg); | |
desc = file.path(.libPaths()[1], pkg); | |
if (dir.exists(desc)) | |
unlink(src, T) | |
else { | |
dir.create(desc); | |
file.rename(src, desc); | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for https://stackoverflow.com/questions/9700799/difference-between-r-base-and-r-recommended-packages