Installing Multiple Version of R on the same machine for macOS (Mac)

 

Recently I wanted to install an application on a Mac, but it required an old version of R (3.2).  On Linux and Windows, that is easy, since you install the application on its own path.  Now, on a Mac, you can do it as well, but it will require extra work if you build it from source.  There is something better!!!  Here I outline what you can do easily…

Note that this illustration assumes that you want R 3.2 & 3.3 on the same system and be able to run either of them when you choose.

  1. Let’s assume that you already installed R 3.3 by downloading it from CRAN.
  2. To install R 3.2, you will need to download an old version from CRAN old R
  3. Before installing R 3.2, run the following commands
    sudo pkgutil --forget org.r-project.R.mavericks.fw.pkg
    sudo pkgutil --forget org.r-project.R.mavericks.GUI.pkg
    sudo pkgutil --forget org.r-project.R.mavericks.GUI64.pkg
  4. Install R 3.2 by double clicking on *.pkg
  5. Now, download and install RSwitch (RSwitch link), which it will allow you to switch between R version by clicking on the R version of your like.
    image

Sources:

Installing Multiple Version of R in parallel on the same machine – Mac OS X | R-bloggers

https://stat.ethz.ch/pipermail/r-sig-mac/2011-August/008534.html

https://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html#How-can-R-for-Mac-OS-X-be-obtained-and-installed_003f

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.