Multiple versions of R

Martin Maechler maechler at stat.math.ethz.ch
Thu Dec 11 10:17:36 CET 2003


>>>>> "Andreas" == Andreas Kiermeier <Andreas.Kiermeier at adelaide.edu.au>
>>>>>     on Thu, 11 Dec 2003 10:25:27 +1030 writes:

    Andreas> Dear all, I have just recently run into a little
    Andreas> dilemma. Due to R's rapid development I have
    Andreas> recently found the need to run two versions of R -
    Andreas> 1.7.1 for completing simulations for my PhD, and
    Andreas> the latest version of R for consulting work. I
    Andreas> would like to use ESS in both case. Is there a way
    Andreas> to have "M-x R" and "M-x R7", say, similar to
    Andreas> running different versions of S+?

    Andreas> I am running ESS version 5.1.21 on GNU Emacs 21.3.1
    Andreas> on Windows 2000 (precompiled version).

You need to make sure that something like "R-1.7" is in your
PATH, i.e., works when typed in a "terminal".

Then, use something like {I have} in the equivalent of your
~/.emacs (something like _emacs in Windows I think) :

(defun R-1.5 (&optional start-args)
  "Call R-1.5, i.e., R version 1.5.1 (2002-06-17) using ESS."
  (interactive "P")(let ((inferior-R-program-name "R-1.5"))(R start-args)))
(defun R-1.6 (&optional start-args)
  "Call R-1.6, i.e., R version 1.6.2 (2003-01-10) using ESS."
  (interactive "P")(let ((inferior-R-program-name "R-1.6"))(R start-args)))
(defun R-1.7 (&optional start-args)
  "Call R-1.7, i.e., R version 1.7.1 (2003-06-16) using ESS."
  (interactive "P")(let ((inferior-R-program-name "R-1.7"))(R start-args)))
(defun R-1.8 (&optional start-args)
  "Call R-1.8, i.e., the latest R version 1.8.x using ESS."
  (interactive "P")(let ((inferior-R-program-name "R-1.8"))(R start-args)))

Then you can use  M-x R-1.7  etc 
Regards,
Martin Maechler <maechler at stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO C16	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><




More information about the ESS-help mailing list