Home | Contact Me
         
       
Study | Resources | Facts of Life
How to install ESS and Emacs on Windows

Click screen shot icon to see what it looks like.

If some screen shots look not clear to you, try to enlarge the size of it by clicking if your operating system is WindowXP.

Install R for Windows.
(I uses R version 1.8.1, and use R GUI for Windows). R GUI screen shot
Know directory structure of your R program.
(I have installed R under a directory called "c:\QingR", which I will later refer as R's root directory). R dir screen shot

Install GNU Emacs for Windows.
(I uses Emacs version 21.3.1). Emacs GUI screen shot
Know directory structure of your Emacs program.
(I have installed Emacs under a directory called "c:\unixsys\emacs-21.3", which I will later refer as Emacs' root directory). Emacs dir screen shot

Put ESS files on your computer.
Download ESS .zip file or tar.gz file.
Uncompress ESS .zip file or tar.gz file extract all files under a directory you specified.
(I unziped ESS version 5.2.0, under "c:\unixsys\ess-5.2.0", which I will later refer as ESS' root directory). ESS dir screen shot

You can either use application such as WinZip, WinRar, or archive functions such as unzip or tar commands which usually come with Unix shell program.

Configure ESS for it to find R executable file Rterm.exe
Find a file called "ess-site.el" under path: ESS' root directory\lisp (On my machine, its whole path with name is: "c:\unixsys\ess-5.2.0\lisp\ess-site.el"). ESS dir screen shot
Search for two lines of code:
;;(setq-default inferior-R-program-name "Rterm") ; msdos systems
;;(setq-default inferior-R-program-name "c:\\Program Files\\R\rw1081\\bin\\Rterm.exe") ; msdos systems
Uncomment those two lines, i.e., removing ";;" from the beginning of the line will reinstate the line as a LISP command.
Change "C:\\Program Files\\R\\rw1081\\bin\\Rterm.exe" to specific path of Rterm.exe on your computer. It is "R's root directory\\bin\\Rterm.exe".
(For my machine, this line of command should be (setq-default inferior-R-program-name "c:\\QingR\\bin\\Rterm.exe")
CAUTION: It is not a typo, you need two back slash like this "\\" for the program to understand the path information.

File "ess-site.el" contains some commands written in LISP, a programming language Emacs understands. This file is used to configure the ESS to find necessary executables files and set initial value for ESS. Instead of using Rgui.exe, ESS uses Rterm.exe to start a session/process of R. Those two lines in configuration file is related to R. The text in brackets () is LISP command. But ";" means all code after it to the end of the line is a comment.

Configure Emacs to load ESS at the beginning of its program
Find a file called "site-start.el" under the path: Emacs' root directory\site-lisp. If it is not there, create one.
(On my machine, its path is: "c:\unixsys\emacs-21.3\site-lisp\site-start.el"). Emacs dir screen shot
There should be only one line of text in "site-start.el":
(load "ESS' root directory/lisp/ess-site.el")
On my machine, the line should read as:
(load "c:/unixsys/ess-5.2.0/lisp/ess-site.el")
CAUTION: It is not a typo, this time it is forward slash "/" for the program to understand the path information.

This file contains some commands written in LISP, a programming language Emacs understands. This file is used to configure the Emacs to load configuration file of ESS, i.e, "ess-site.el".

Start the Emacs, use key combination command: M-x R to start a R process. R on Emacs screen shot

     
Qing Li
Biostatistics Dept. Bloomberg School of Public Health
Baltimore, MD 21205
qli@jhsph.edu

JHU Lib | JHSPH | Biostatistics Dept
SLAM | Karl Broman Website | Faculty | R Base Doc
Study | Resources | Facts of Life | Home
Page Last Updated: Feb. 2006   © 2003 Qing Li   All Rights Reserved.