ESS to call different installations of R
Asked Answered
A

2

12

I am not sure if this has already been answered here on stack-overflow. I had Emacs-ESS installed on my Unix machine and when ever I start up emacs, particular version of R gets loaded. I now have some new R packages that I wanted to test before installing into default R environment. Hence I installed newer version of R in a local directory and have my new packages installed there. Now if I want to call this newer R version that I installed in a local directory, from emacs, how exactly should I be doing it? I want to be able to call either the default R version or the locally installed R-version.

Thanks for all your time and help

Annulus answered 6/5, 2011 at 4:51 Comment(0)
T
14

ESS can start other versions of R, provided that it knows where on your system they are located. Pasted below is the relevant section from the ESS manual:

If you have other versions of R or S-Plus available on the system, ESS is also able to start those versions. How this exactly works depend on which OS you are using, as described in the following paragraphs. The general principle, regardless of OS, is that ESS searches the paths listed in the variable exec-path for R binaries. If ESS cannot find your R binaries, on Unix you can change the unix environment variable PATH, as this variable is used to set exec-path.

R on Unix systems: If you have "R-1.8.1" on your exec-path, it can be started using M-x R-1.8.1. By default, ESS will find versions of R beginning "R-1" or "R-2". If your versions of R are called other names, consider renaming them with a symbolic link or change the variable ess-r-versions. To see which functions have been created for starting different versions of R, type M-x R- and then hit [Tab]. These other versions of R can also be started from the "ESS->Start Process->Other" menu.

Telescopy answered 6/5, 2011 at 5:53 Comment(3)
Also M-x customize-variable and then inferior-R-program-name.Scurrility
ESS will also find versions of R beginning with R-3, R-devel & R-patched.Filling
update: (TIL) other versions of R discovered by ESS during package load are any executable on exec-path whose basename begins with any of "R-1" "R-2" "R-3" "R-4" "R-5" "R-6" "R-7" "R-devel" "R-patched" (though I would recommend Martin's approach to the use case presented in the question).Subtropical
G
-1

These methods didn't work for me. I changed the PATH option to point at the version I wanted, then restarted emacs, and that worked.

Greenlet answered 14/8, 2017 at 15:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.