User manual
Chapter 3: Interacting with statistical programs 21
3 Interacting with statistical programs
As well as using ESS to edit your source files for statistical programs, you can use ESS to
run these statistical programs. In this chapter, we mostly will refer by example to running
S from within emacs. The emacs convention is to name such processes running under its
control as ‘inferior processes’. This term can be slightly misleading, in which case these
processes can be thought of ‘interactive processes’. Either way, we use the term ‘iESS’ to
refer to the Emacs mode used to interact with statistical programs.
3.1 Starting an ESS process
To start an S session on Unix or on Windows when you use the Cygwin bash shell, simply
type M-x S RET.
To start an S session on Windows when you use the MSDOS prompt shell, simply type
M-x S+6-msdos RET.
S will then (by default) ask the question
S starting data directory?
Enter the name of the directory you wish to start S from (that is, the directory you would
have cd’d to before starting S from the shell). This directory should have a ‘.Data’ subdi-
rectory.
You will then be popped into a buffer with name ‘*S*’ which will be used for interacting
with the ESS process, and you can start entering commands.
3.2 Running more than one ESS process
ESS allows you to run more than one ESS process simultaneously in the same session. Each
process has a name and a number; the initial process (process 1) is simply named (using S-
PLUS as an example) ‘S+3:1’. The name of the process is shown in the mode line in square
brackets (for example, ‘[S+3:2]’); this is useful if the process buffer is renamed. Without a
prefix argument, M-x S starts a new ESS process, using the first available process number.
With a prefix argument (for R), C-u M-x R allows for the specification of command line
options.
You can switch to any active ESS process with the command ‘M-x
ess-request-a-process’. Just enter the name of the process you require; com-
pletion is provided over the names of all running S processes. This is a good command to
consider binding to a global key.
3.3 ESS processes on Remote Computers
ESS works with processes on remote computers as easily as with processes on the local
machine. The recommended way to access a statistical program on remote computer is to
start it with tramp. Require tramp in your .emacs file:
(require ’tramp)
Now start an ssh session with ‘C-x f /ssh:user@host: RET’. Tramp should open a dired
buffer in your remote home directory. Now call your favorite ESS process (R, Julia, stata
etc) as you would usually do on local machine: M-x R.










