Below is a guide to installing Microsoft Open R for those using Ubuntu Linux and R-Studio. Microsoft R Open (MRO) is a pretty powerful distribution of R (and yes, completely open source). It builds off (currently) R version 3.3.0, adding some darn useful enhancements, due in part to their use of Intel’s Math Kernel Library (MKL).
What does this mean? Basically Microsoft R Open is an optimized version of your standard R, and can help tremendously if you’re doing, say, many intense vector or matrix-based operations. Importantly, much of this is done for you: instead of having to fiddle around with multi-core support in your code, R Open optimizes things automatically.
Before stumbling across Revolution R, the predesessor to Microsoft R Open, I didn’t know there were other distributions of R floating around. Switching to Microsoft R Open simply means you’re installing an enhanced version of R over the default version. Everything works the same. There is nothing special you have to do (other than installing your previous packages, which is covered below). If you’re using RStudio, like most people out there, RStudio will automatically use the new, enhanced R.
Before installing Microsoft R Open, you want to keep track of all the packages you’ve installed. Because we’re installing a new version of R underneath RStudio, we wont have access to our old packages.
The following R code saves a list of packages that are currently installed in R. A
.Rda file containing the installed package list will be saved in your default working directory. (If you need a reminder of your current working directory type
getwd() into R.)
The above code is essentially the same as Data Science Riot.
Once we setup R Open, we’ll evoke this
.Rda file to automatically (re-)install the old packages.
Next, we download and install Microsoft R Open: https://mran.revolutionanalytics.com/download/.
If, like me, you juggle multiple systems and can’t keep track of which version of Ubuntu you have, type the following command into the terminal:
Then download the appropriate version of R Open and the MKL libraries.
After downloading, first install the Microsoft R Open Debian package:
Next install the MKL libraries by unzipping and then running the installation script located in the
If everything has gone smoothly, the extra math libraries will have now been installed onto your system.
Now, re-open RStudio. Magically (and hopefully), RStudio should recognize the new R Open program and automatically setup the multi-core support. I have installed R Open on all my systems and have never had issues with RStudio recognizing the new flavour or R. If things have gone well, you should see the following message in the console RStudio console:
The message confirms that the combination or Microsoft R Open and the associated libraries have blessed you with multi-core support. Which saves you from having to setup a multi-core “by hand.”
Now that RStudio “sees” Microsoft R Open as our default version of R, we return to our
.Rda file and use it to automatically install all the old packages:
If you’re like me, you may have sit back for a while and watch R hypnotically re-install the list of packages onto your distribution.
26 Jul 2016