User manual
Chapter 3: Interacting with statistical programs 22
Alternatively you can start your process normally (M-x R). After you are asked for
starting directory, simply type ‘/ssh:user@host: RET’. R process will be started on the
remote machine.
To simplify the process even further create a "config" file in your .ssh/ folder and add
an account. For example if you use amazon EC2, it might look like following:
Host amazon
Hostname ec2-54-215-203-181.us-west-1.compute.amazonaws.com
User ubuntu
IdentityFile ~/.ssh/my_amazon_key.pem
ForwardX11 yes
With this configuration /ssh:amazon: is enough to start a connection. The ForwardX11
is needed if you want to see R graphic device showing on the current machine
Other ways to setup a remote ESS connection are through ess-remote.
1. Start a new shell, telnet or ssh buffer and connect to the remote computer
(e.g. use, ‘M-x shell’, ‘M-x telnet’ or ‘M-x ssh’; ssh.el is available at
http://www.splode.com/~friedman/software/emacs-lisp/src/ssh.el).
2. Start the ESS process on the remote machine, for example with one of the commands
‘Splus’, or ‘R’, or ‘sas -stdio’.
3. Start ‘M-x ess-remote’. You will be prompted for a program name with completion.
Choose one. Your process is now known to ESS. All the usual ESS commands (‘C-c
C-n’ and its relatives) now work with the S language processes. For SAS you need
to use a different command ‘C-c i’ (that is a regular ‘i’, not a ‘C-i’) to send lines
from your ‘myfile.sas’ to the remote SAS process. ‘C-c i’ sends lines over invisibly.
With ess-remote you get teletype behavior—the data input, the log, and the listing
all appear in the same buffer. To make this work, you need to end every PROC and
DATA step with a "RUN;" statement. The "RUN;" statement is what tells SAS that
it should process the preceding input statements.
4. Graphics (interactive) on the remote machine. If you run X11 (See Section 11.5.2 [X11],
page 58, X Windows) on both the local and remote machines then you should be able to
display the graphs locally by setting the ‘DISPLAY’ environment variable appropriately.
Windows users can download ‘xfree86’ from cygwin.
5. Graphics (static) on the remote machine. If you don’t run the X window system on the
local machine, then you can write graphics to a file on the remote machine, and display
the file in a graphics viewer on the local machine. Most statistical software can write
one or more of postscript, GIF, or JPEG files. Depending on the versions of emacs and
the operating system that you are running, emacs itself may display ‘.gif’ and ‘.jpg’
files. Otherwise, a graphics file viewer will be needed. Ghostscript/ghostview may be
downloaded to display ‘.ps’ and ‘.eps’ files. Viewers for GIF and JPEG are usually
included with operating systems. See Section 13.5 [ESS(SAS)–Function keys for batch
processing], page 71, for more information on using the F12 key for displaying graphics
files with SAS.
Should you or a colleague inadvertently start a statistical process in an ordinary
‘*shell*’ buffer, the ‘ess-remote’ command can be used to convert it to an ESS buffer
and allow you to use the ESS commands with it.










