[ESS] toggle between R versions

Douglas Bates bates at stat.wisc.edu
Wed Feb 6 14:56:37 CET 2008

I saw the replies by Rich and by Martin to your question but I just
wanted to point out that there is another, I think cleaner, solution
to your problem.

On Feb 5, 2008 10:10 PM, Mark W Kimpel <mwkimpel at gmail.com> wrote:
> I have both R-2.6.1 and R-devel installed on Ubuntu Gutsy, each with
> their own site-library, although currently I go into .Rprofile to
> manually change with site-library will be loaded. When starting R from
> within ESS-Emacs, I would like to be able to instruct which version I
> want to use. Is this possible? For this to work, I would also need
> .Rprofile to detect the version of R and use the appropriate site-library.

Recent releases of R use an environment variable R_LIBS_USER that
defaults to ~/R/${arch}-library/${version}

So for me on a Ubuntu amd_64 system the R-devel library is in


and the R-2.6.1 user library path is the same except ending in 2.6

Try establishing those directories (use sessionInfo()) in an R session
to check the setting of your ${arch} variable) and see if that is the
default installation target for you.  That way you won't need to worry
about resetting the site-library.  I am assuming that you are doing
this on a personal machine.  If you are doing this for a shared system
where site-library is different from your personal library you may
need to change the approach.

More information about the ESS-help mailing list