[R] Emacs & ESS under Windows

Emmanuel Paradis paradis at isem.univ-montp2.fr
Sat Mar 3 21:50:34 CET 2001


After the discussions about appropriate editors under Windows to use with
R, I have managed to install Emacs, XEmacs, and ESS under WinNT 4.0, and
these work fine. It's not necessary to compile anything to use R with ESS,
just to install Emacs and ESS, and do a few modifications in some files.
XEmacs is also easy to install but apparently ESS cannot run with it
(confirmed by a message by Tony Rossini).

A point is probably that most people who start with R are a bit
disoriented, thus telling them to learn also Emacs and ESS is a bit too
much at once. To try to remedy this, I have summarized the steps to install
Emacs and ESS. I have indicated the versions I used, but did not try
others. I welcome comments and suggestions on this(I shall probably include
this in my doc "R for beginners").

(I have found the setup I describe below to not have all the
functionnalities of XEmacs + ESS under Solaris. Is that because I did not
compile the ESS files?)


Emmanuel Paradis


+----------------------------------+
| How to install ESS under Windows |
+----------------------------------+
1. Download a precompiled copy of Emacs v. 20.4 for Windows on Intel machines:

	ftp://ftp.gnu.org/gnu/windows/emacs/20.4/emacs-20.4-bin-i386.tar.gz

2. Unpack the downloaded file in a directory, e.g., "D:\", then execute the
file "D:\emacs-20.4\addpm.exe". Emacs is then installed on your Windows
machine, and a shortcut should have been added to your start menu.

3. Download ESS v. 5.1.8 at:

	http://ess.stat.wisc.edu/pub/ESS/ESS-5.1.8.zip

4. Unpack the downloaded file in "D:\emacs-20.4\lisp\" (of course, keeping
the tree structure of the zip archive).

5. Edit the file "D:\emacs-20.4\lisp\ess-5.1.8\lips\ess-site.el", and
modify the line #144 to this:

(setq-default inferior-R-program-name "D:/rw1021/bin/Rterm.exe")  ; msdos
systems

This is if you installed R for Windows in D:\; if you installed it, for
instance, in C:\Program Files, then this line must be:

(setq-default inferior-R-program-name "C:/Program
Files/rw1021/bin/Rterm.exe")  ; msdos systems

(The semicolons in this file indicate comments.)

6. Add a file called "_emacs" in C:\ with the following line in it:

(load-file "d:/emacs-20.4/lisp/ess-5.1.8/lisp/ess-site.el")

7. ESS is now configured to run with R and Emacs, but it is very handy to
create a type for *.R files that opens Emacs directly. To do this, open
Explorer.exe, then open "options" in the menu "display", select the thumb
"types of files", click on "New type...", file the fields, and under
"actions", click "New...", a new window is then open. Under "action" type
"open", and the second field type D:\emacs-20.4\bin\emacs.exe. Close all
windows by clicking "Ok".

[Note: this is approximately translated from my French WinNT menus]

Now, when you open a *.R file, this opens directly Emacs and ESS. To run R
under Emacs, type Alt-x R, and then Enter (this will open a DOS-like
window, so you have to come back to Emacs). You switch between the
different files, buffers, processes, ... with the menu "Buffers". When you
edit a *.R file you can evaluate the R expressions with the "ESS" menu by
selecting "eval buffer".


EP
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list