When I was in school the system administrator had multiple versions of R installed. I\'m running into a bug with R-3.1.0 and need to install reinstall some past versions of
Yes, this is pretty easy as Josh Ulrich's comment already says.
People usually have this question regarding r-devel installation alongside the basic R you will get from your distro. I use a simple shell script to build / update R-devel, and two matching ones to run R-devel and Rscript-devel. I can't recall if I blogged about it, but folks seem to point to an this older post on the r-sig-debian list which contains it. Here is a nice post by Michael detailing the same process.
And by creating new subdirectories, you can add as many R version as you want. You should keep the local builds in /usr/local
, though, and could create softlinks for the binaries in /usr/local/bin
. The script R
itself will have R_HOME_DIR
hard-coded and "just work".
Fancier approaches involve virtualization, and on Linux your best bet is docker which I am playing with now, and which I hope to detail at some point for this very purpose of testing R packages against multiple compilers etc.
I'm not an expert on R but on Linux you can always use schroot and debootstrap to create a new isolated environement with different versions of R, libraries, ... Actually I use it to compile different versions of code for RedHat, Ubuntu or Debian.
See for example: https://wiki.ubuntu.com/DebootstrapChroot
(Once you get use to it, it will take no more than 20 minutes to create a new chrooted system)