简体   繁体   中英

ESS to call different installations of R

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

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 Mx 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 Mx R- and then hit [Tab]. These other versions of R can also be started from the "ESS->Start Process->Other" menu.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM