Amazon EC2: Upgrading R
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
After installing R and Shiny on my EC2 instance I discovered that the default version of R was a little dated and I wanted to update to R 3.2.0. It’s not terribly complicated, but here are the steps I took.
First, become root.
$ sudo /bin/bash
Remove the old version of R.
# apt-get remove r-base-core
Edit /etc/apt/sources.list
and add the following:
deb http://cran.rstudio.com/bin/linux/ubuntu trusty/
Back in the shell, add the public keys.
# gpg --keyserver keyserver.ubuntu.com --recv-key E298A3A825C0D65DFD57CBB651716619E084DAB9 # gpg -a --export E298A3A825C0D65DFD57CBB651716619E084DAB9 | apt-key add -
Update the package list and install the new base R package.
# apt-get update # apt-get upgrade # apt-get install r-base
When you launch R you should find that it is the sparkling new version.
Now you will want to update all of the packages too, so launch R (as root) and then do:
> update.packages(lib.loc = "/usr/local/lib/R/site-library", ask = FALSE)
If you have packages installed in a user library, you should update those too.
Finally, if you run into memory problems with the package updates, then you’ll need to add a swap file.
The post Amazon EC2: Upgrading R appeared first on Exegetic Analytics.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.