Skip to content

Instantly share code, notes, and snippets.

@iangow
Last active December 30, 2020 16:27
Show Gist options
  • Save iangow/3f483d165ab528587a335e55a0f138d9 to your computer and use it in GitHub Desktop.
Save iangow/3f483d165ab528587a335e55a0f138d9 to your computer and use it in GitHub Desktop.
Code to install R from the command line
wget https://cran.rstudio.com/bin/macosx/R-4.0.3.pkg
sudo installer -pkg R-4.0.3.pkg -target /
rm R-4.0.3.pkg
@iangow
Copy link
Author

iangow commented Apr 29, 2018

And use this to re-install packages:

pkgs <- basename(list.dirs("/Library/Frameworks/R.framework/Versions/3.4/Resources/library",
                           recursive = FALSE))
install.packages(pkgs, lib="/Library/Frameworks/R.framework/Versions/3.5/Resources/library",
                 dependencies = TRUE)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment