ESS -- Emacs Speaks Statistics

ESS is an add-on to emacs to allow easy editing and saving of files while running stat packages. I use it only with R but it does also work with SAS and other programs.

To run ESS, open an emacs window and open a file ending with .r, .s, or .q.
If the grey line near the bottom does not show (ESS), then you haven't loaded it up yet. Emacs will do this for you automatically if you have the line

(require 'ess-site)
in your .emacs file
Alternatively, on the math department system, you can copy my file over to your home directory:
cp ~jimrc/.emacs .
You can open an R session by typing Meta-X R. Then select "New Frame" in the File menu to open a new window, and select the buffer needed under the "Buffer" menu. I like to have one window for the R session and another for a file where I save the commands that worked and any output I might need later.
Commonly used ESS commands are then in the "ESS" menu. Most useful is the ability to copy lines of code into the *R* buffer and execute them. I highlight a region and press C-C C-R.

I use a myRfile.r window to store a record of things that worked in the stat package, both commands and output. Commands are typed into the *R* window. If they work I copy them and any interesting output to the file.r window to be saved.

I also find the search capabilites useful. To rerun a command that included lm(y~x), just push C-c C-r and the first few letters of lm(y~x). Push return, and the latest command using lm(y~x) will reappear. If you just want to correct and rerun the last command, Alt-P will bring it back.

Documentation

To obtain a copy of ESS, check the main ESS website.
Info on unix and emacs.

Other Stat package demos for unix packages:


Back to MSU Math Department Home Page


Author: Jim Robison-Cox
Last Updated: Tuesday, 14-Jun-2011 16:52:23 MDT