1. Introduction to ESS
The S and Splus packages provide sophisticated statistical and
graphical routines for manipulating data. S-mode, the package on which
ESS was based, provided a programming environment for data analysis and
statistical programming, as well as an intelligent interface to the S
process.
The ESS (:= Emacs Speaks Statistics) package is an
extension of S-mode to provide a common, generic, and useful interface,
through Emacs, to many statistical packages. It has currently been
extended for R, XLisp-Stat, and SAS, with other statistical languages
such as Stata, SPSS, and Fiasco slated for implementations in the
future.
A bit of notation before we begin. Emacs refers to both
Emacs as distributed by the Free Software Foundation, as well as
XEmacs, which is a second GNU version of Emacs. The Emacs major
mode ESS[language]
which is used for editing source for dialect
language
, can take values S
, SAS
, or XLS
,
for instance. The inferior process interface (the connection between
Emacs and the running process) referred to as interactive ESS
(iESS
), is denoted in the modeline by ESS[dialect]
, where
dialect
can take values S3
, S4
, S+3
,
R
, XLS
, VST
, SAS
, as well as others.
Currently, the documentation contains many references to `S'
where actually any supported (statistics) language is meant, i.e., `S'
could also mean `XLisp-Stat' or `SAS'.
For exclusively interactive users of S, ESS provides a number of
features to make life easier. There is an easy to use command history
mechanism, including a quick prefix-search history. To reduce typing,
command-line completion is provided for all S objects and "hot
keys" are provided for common S function calls. Help files are
easily accessible, and a paging mechanism is provided to view them.
Finally, an incidental (but very useful) side-effect of ESS is that a
transcript of your session is kept for later saving or editing.
No special knowledge of Emacs is necessary when using S
interactively under ESS.
For those that use S in the typical edit--test--revise cycle when
programming S functions, ESS provides for editing of S functions
in Emacs edit buffers. Unlike the typical use of S where the editor
is restarted every time an object is edited, ESS uses the current Emacs
session for editing. In practical terms, this means that you can edit
more than one function at once, and that the ESS process is still
available for use while editing. Error checking is performed on
functions loaded back into S, and a mechanism to jump directly to the
error is provided. ESS also provides for maintaining text versions of
your S functions in specified source directories.
1.1 Why should I use ESS?
S is a powerful system for manipulating and analyzing data, but its user
interface -- particularly on Unix platforms -- leaves something to be
desired. ESS is a package which is designed to make S easier to
use.
ESS provides several features which make it easier to interact with the
ESS process (i.e. enter commands and view the output). These
include:
-
Command-line editing for fixing mistakes in commands before they are
entered. The `-e' flag for S-plus provides something similar to
this, but here you have the full range of Emacs commands rather than a
limited subset. However, other packages such as XLisp-Stat and S3 do not
necessarily have features like this built-in.
See section 3.1 Entering commands and fixing mistakes.
-
Searchable command history for recalling previously-submitted
commands. This provides all the features of the `Splus -e' history
mechanism, plus added features such as history searching.
See section 3.5 Command History.
-
Command-line completion of both object and file names for quick
entry. This is similar to
tcsh
's facility for filenames; here it
also applies to object names and list components.
See section 3.2 Completion of object names.
-
Hot-keys for quick entry of commonly-used commands in `S' such as
objects()
and search()
.
See section 3.7 Hot keys for common commands.
-
Transcript recording for a complete record of all the actions in an
S session.
See section 3.4 Manipulating the transcript.
-
Interface to the help system, with a specialized mode for viewing S
help files.
See section 5. Reading help files in ESS.
If you commonly create or modify S functions, you will have found
the standard facilities for this (the `fix()' function, for
example) severely limiting. Using S's standard features, one can only
edit one function at a time, and you can't continue to use S while
editing. ESS corrects these problems by introducing the following
features:
-
Object editing. ESS allows you to edit more than one function
simultaneously in dedicated Emacs buffers. The ESS process may
continue to be used while functions are being edited.
See section 4.1 Creating or modifying S objects.
-
A specialized editing mode for S code, which provides syntactic
indentation and highlighting.
See section 4.5 Indenting and formatting S code.
-
Facilities for loading and error-checking source files, including a
keystroke to jump straight to the position of an error in a source file.
See section 4.3 Detecting errors in source files.
-
Source code revision maintenance, which allows you to keep historic
versions of S source files.
See section 4.7 Maintaining S source files.
-
Facilities for evaluating S code such as portions of source
files, or line-by-line evaluation of files (useful for debugging).
See section 4.4 Sending code to the ESS process.
Finally, ESS provides features for re-submitting commands from saved
transcript files, including:
1.2 New features in ESS
Changes/New Features in 5.1.20:
- New `options()$STERM' in the S dialects (S, S-Plus, R).
The S program can determine the environment in which it is
currently running. ESS sets the option to `iESS' or `ddeESS'
when it starts an S language process. We recommend other specific
values for S language processes that ESS does not start.
- New `ess-mouse-me' function, assigned to S-mouse-3 by default.
User may click on a word or region and then choose from the
menu to display the item, or a summary, or a plot, etc.
This feature is still under development.
- GNU Emacs 21.1 is now supported (fixed for S dialects, SAS & BUGS),
(some from Stephen Eglen).
- XEmacs 21.x is now supported (fixed w32-using-nt bug)
- XEmacs on Win (NT) is better supported.
- Workaround for bug in Sqpe+6 (S-PLUS 6 for Win).
- should now work even when imenu is not available (for old Xemacsen).
- for SAS : XEmacs-Imenu fix; C-TAB is globalized along with your
function-key definitions, if specified; you can specify your SAS
library definitions outside of autoexec.sas for ess-sas-data-view
with SAS code placed in the variable ess-sas-data-view-libname,
also the dataset name is defaulted to the nearest permanent dataset
to point; Speedbar support now works for permanent datasets, please
ignore first./last.; new font-locking is now the default with more
improvements for font-locking PROCs, macro statements, * ; and %* ;
comments; you can toggle sas-log-mode with F10 which will font-lock
your .log (if it isn't too big); submit remote .sas files accessed
with ange-ftp, EFS or Tramp (Kermit is experimental) by setting
ess-sas-submit-method to 'sh; ess-sas-submit-command and
ess-sas-submit-command-options are buffer-local so you can have
local file variable sections at the end of your .sas files to
request different executables or specify special options and the
local file variables are re-read at submit instead of only at file
open so that if you make a change it is picked up immediately;
- for BUGS: font-lock with `in' fixed.
- for STATA: font-lock bug fixed.
- for Rd mode: C-c C-v and `switch-process' in menu.
further, C-c C-f prefix (Rd-font) for inserting or surrounding a word
by things such as \code{.}, \code{\link{.}}, \emph{.} etc.
- new functions (ess-directory-function) and (ess-narrow-to-defun)
ess-directory <-> default-directory logic (Jeff Mincy).
- Re-organized Makefile and fixed a few bugs.
Changes/New Features in 5.1.19:
- S+6 now supported (Tony Rossini (Unix) and Rich Heiberger (Windows))
- New BUGS support through ESS[BUGS] mode (Rodney Sparapani)
Templates assist you in writing .bug and .cmd code (.cmd and .log
are replaced by .bmd and .bog to avoid emacs extension collisions).
Substitution" parameters facilitate "automagic" generation of
data...in" and "init...in" filenames, "const N=" from your data
file and "monitor()/stats()" commands. Activated by pressing F12.
- Fixes for `ess-smart-underscore' SAS breakage (Rich Heiberger)
- You can change between PC and Unix, local and global SAS function-key
definitions interactively (Rich Heiberger)
- C-Submit a highlighted region to SAS batch (Rodney Sparapani)
- New and improved SAS syntax highlighting (Rodney Sparapani)
To get the new functionality, set ess-sas-run-make-regexp to nil.
Also available in .log files via F10.
- Open a permanent SAS dataset for viewing via F9 (Rodney Sparapani)
You must have the library defined in autoexec.sas for it to work.
- User-friendly defaults for `sas-program', `ess-sas-batch-pre-command'
and `ess-sas-batch-post-command' as well Customize support for these
and other ESS[SAS] variables (Rodney Sparapani)
- `ess-sas-suffix-2' now defaults to .dat via F11 (Rodney Sparapani)
- Emacs/XEmacs, Unix/Windows issues collectively handled in ess-emcs.el
- defadvice solves problem of missing *ESS* (thanks to Jeff Mincy)
- Improved manual a bit by including things that were only in `README'.
Changes/New Features in 5.1.18:
- New `ess-smart-underscore' function, now assigned to "_" by default.
Inserts `ess-S-assign' (customizable " <- "), unless inside string
and comments where plain "_" is used instead. (MM)
- Fixes for longstanding interactive SAS breakage (RMH)
Changes/New Features in 5.1.17:
- Documentation for Windows Installation (Rich Heiberger
(rmh@surfer.stat.temple.edu))
- removal of ess-vars, finalization of customize support (in the
sense that there is no more use of ess-vars, but that we need to
fix ess-cust) (AJ Rossini (rossini@u.washington.edu))
- Many small (and large) fixes/contributions (MMaechler,
(maechler@stat.math.ethz.ch)).
- addition of the "S-equal" variable and provide M-x ess-add-MM-keys
a way to remap "_" to `ess-S-assign', typically " <- ", but
customizable. (MMaechler, (maechler@stat.math.ethz.ch)).
Changes/New Features in 5.1.16:
- BUG FIXES
- Better SAS support
Changes/New Features in 5.1.15:
Changes/New Features in 5.1.14:
Changes/New Features in 5.1.13:
- Version numbering finally all depending on the ./VERSION file,
thanks to Martin Maechler.
- Yet more fixes to SAS mode, thanks to Rich Heiberger
(rmh@surfer.stat.temple.edu).
Changes/New Features in 5.1.12:
Changes/New Features in 5.1.11:
- More fixes to Stata mode, thanks to Brendan Halpin
(brendan@essex.ac.uk)
- fixed bugs in ESS-elsewhere, thanks to many testers
- README.SPLUS4WIN has DETAILED instructions for S-PLUS 2000, thanks
to David Brahm (brahm@alum.mit.edu).
- Fixes to SAS mode, thanks to Rodney Sparapani
(rsparapa@mcw.edu)
Changes/New Features in 5.1.10:
- More fixes to Stata mode
- primitive generic version of ESS-elsewhere
- Small fixes to SAS/Stata.
Changes/New Features in 5.1.9:
- Stata mode works
- Literate Data Analysis using Noweb works
Changes/New Features in 5.1.8:
- Bug fixes
- R documentation mode defaults changed
Changes/New Features in 5.1.2:
- able to use inferior iESS mode to
communicate directly with a running S-Plus 4.x process using the
Microsoft DDE protocol. We use the familiar (from Unix ESS) C-c C-n
and related key sequences to send lines from the S-mode file to the
inferior S process. We continue to edit S input files in ESS[S] mode
and transcripts of previous S sessions in ESS Transcript mode. All
three modes know the S language, syntax, and indentation patterns and
provide the syntactic highlighting that eases the programming tasks.
1.3 Authors of and contributors to ESS
ESS is based on Olin Shivers' excellent comint package (which is supplied
with version 19 of GNU Emacs). The original version of ESS (then known
as `S-mode') was written by Doug Bates (bates@stat.wisc.edu) and
Ed Kademan (kademan@stat.wisc.edu). Frank Ritter
(ritter@psy.cmu.edu) then merged this version with his own
S-mode mode to form `S.el' version 2.1.
Version 2.1 of `S.el' was then updated and expanded by David Smith
to form version 3.4. This was then updated for Emacs 19 to create
version 4. Most bugs have now been fixed (and several new ones
introduced) and many new features have been added. Thanks must go to
the many people who have helped with the development of the present
version of ESS:
-
The multiple process code, and the idea for
ess-eval-line-and-next-line
are by Rod Ball.
-
Thanks to Doug Bates for many useful suggestions.
-
Thanks to Martin Maechler for reporting and fixing bugs, providing many
useful comments and suggestions, and for maintaining the S-mode mailing
list.
-
Thanks to Frank Ritter for updates from the previous version, the menu
code, and invaluable comments on the manual.
-
Thanks to Ken'ichi Shibayama for his excellent indenting code, and many
comments and suggestions.
-
Last but definitely not least, thanks to the many beta testers of the
S-mode and ESS mailing lists.
The new version, ESS version 5, is being developed and currently
maintained by
1.4 Getting the latest version of ESS
The latest stable version of ESS is always available on the web at:
http://software.biostat.washington.edu/statsoft/ess/ or
http://lib.stat.cmu.edu/general/ESS/
1.5 How to read this manual
If ESS has already been installed on your system, the next chapter has
details on how to get started using S under ESS.
If you need to install ESS, read A. Installing ESS on your system for details on what
needs to be done before proceeding to the next chapter.
B. Customizing ESS provides details of user variables you can change to
customize ESS to your taste, but it is recommended that you defer this
section until you are more familiar with ESS.
Don't forget that this manual is not the only source of information
about ESS. In particular, the mode-based online help (obtained by
pressing C-h m when in the process buffer, edit buffer or help
buffer) is quite useful. However the best source of information is, as
always, experience -- try it out!
This document was generated
by Camm Maguire on March, 4 2002
using texi2html