File: jsm2002.tex

package info (click to toggle)
ess 5.11-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 11,108 kB
  • ctags: 1,759
  • sloc: lisp: 18,021; sh: 1,544; asm: 862; makefile: 307; xml: 193
file content (251 lines) | stat: -rw-r--r-- 11,614 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
\documentclass{article}

%\renewcommand{\baselinestretch}{1.5}
\addtolength{\oddsidemargin}{-0.5in}
%\addtolength{\topmargin}{-0.2in}
\addtolength{\textheight}{0.2in}
\addtolength{\textwidth}{1in}

%%%
\usepackage[authoryear,round]{natbib}
%or (if you have an unshiny latex installation)
%\newcommand{\citep}[1]{{\{\sf#1\}}}
%%%
\usepackage{alltt}

%% Postscript fonts
%\usepackage{times}
\usepackage{graphicx}

\ifx\pdfoutput\undefined
  %% Stuff wout hyperref
  \def\url#1{\textsf{#1}} % To help fit in lines
\else
  %% Stuff with hyperref
  \usepackage{hyperref}
  %%\hypersetup{backref,colorlinks=true,pagebackref=true,hyperindex=true}
  \hypersetup{backref,colorlinks=false,pagebackref=true,hyperindex=true}
\fi

%%---End of package requiring ---------- Own Definitions -------------

\newcommand{\SAS}{\textsc{SAS}$^{\mbox{\scriptsize\textregistered}}$}
\newcommand{\Splus}{\textsc{S-Plus}}
\newcommand*{\XLispStat}{\textsc{XLispStat}}
\newcommand*{\Stata}{\textsc{Stata}}
\newcommand*{\Rgui}{\textsc{Rgui}}
\newcommand*{\Perl}{\textsc{Perl}}
\newcommand*{\Fortran}{\textsc{Fortran}}
\newcommand*{\Scmt}[1]{\hbox{\qquad {\footnotesize \#\#} \textsl{#1}}}
\newtheorem{defn}{Definition}[section]
\newtheorem{ex}{Example}[section]

\newcommand{\stexttt}[1]{{\small\texttt{#1}}}
\newcommand{\ssf}[1]{{\small\sf{#1}}}
\newcommand{\elcode}[1]{\\{\stexttt{\hspace*{2em} #1}}\\}
\newenvironment{Salltt}{\small\begin{alltt}}{\end{alltt}}
\newcommand{\US}{{\char'137}}        % \tt _
\newcommand{\marpar}[1]{\marginpar{\raggedright#1}}
\newcommand{\file}[1]{`\stexttt{#1}'}

%%--------------------------------------------------------------- Start Text

\title{Emacs Speaks Statistics:  A Rapid Application Development (RAD)
  Environment for Statistical Analysis Packages}

\author{Rodney Sparapani \footnote{%
Rodney Sparapani is Senior Biostatistician at the Medical College
of Wisconsin, Milwaukee, WI, USA (E-mail: rsparapa@mcw.edu).
Acknowledgements.  A special thanks to all of the ESS developers, both past
    and present:  A.J. Rossini, Richard M. Heiberger, Martin M{\"a}chler, 
    Kurt Hornik, Jeff Mincy, Doug Bates, Ed Kademan, Frank Ritter, Mike Meyer, 
    David Smith, Tom Cook, John Sall and Brian Ripley.  Also, I'd like to thank
    all of the developers of GNU Emacs, XEmacs and their many modes without which
    none of this would have been possible.}}

\date{\today}

\begin{document}

\maketitle

\section{Introduction}
\label{sec:introduction}

Software developers rely on Rapid Application Development (RAD)
environments to assist them in the complex process of software
development which includes the varied tasks of computer
programming, project management and software testing.  The Emacs text
editor is a powerful RAD tool in the software developers' toolbox.
Common tasks faced by a statistician are not much different from those
faced by software developers, since much statistical
activity involves some form of computer use.  Many
statistical research activities, particularly data analysis and
communication, are enhanced by computers.  This puts the computer
in the critical role of facilitating these
tasks.  One such RAD is Emacs Speaks Statistics (ESS).

ESS provides an interface to statistical packages, and provides,
through Emacs, additional tools which facilitate both statistical
software development and data analysis.  The most beneficial part  
comes from learning a powerful RAD tool like Emacs and using it for 
many common tasks and statistical analysis package programming as well. 
ESS currently supports the S family of languages (which include
S, \Splus, and R); \SAS;  BUGS; \Stata; and \XLispStat\
and its extensions Arc and ViSta.  ESS can be
extended to accommodate most statistical packages which provide either
an interactive command-line or batch file processing.  The documentation 
that comes with ESS provides details of its implementation and examples 
of its use.


\section{Emacs}
\label{sec:emacs}

Emacs is a mature, powerful, and extensible text editing system which
is freely available under the GNU General Public License for a large
number of platforms, including most flavors of Unix, Microsoft Windows
and Apple Macintosh.  There are two open-source, free-software
implementations of Emacs:  GNU Emacs and XEmacs.
Emacs shares many features with
word processors, and some characteristics with operating systems.
Most importantly, Emacs can interact with and control other programs.

\paragraph{Keyboard and Mouse Interaction.}
When Emacs was originally written, character-based terminals with only
a keyboard for input were the most advanced method of access to
computers.  Common Emacs commands were mapped (or bound) to key
sequences for ease of use.  These days, Emacs is
rarely used within a terminal or terminal-emulator, but key-mapping of
commands is still an important time-saving feature.  Over the last
decade, Emacs has been extended to use graphics-based windowing
systems such as X11, Microsoft Windows, and Apple Macintosh.  These
windowing systems provide a graphical user interface (GUI) which
allows the user to interact with either a keyboard or a mouse, and 
encourage multiple applications to share a single display.  Emacs 
menus allow mouse access to frequently used actions providing a
speedy alternative when the user doesn't know or can't remember 
a key-mapping.  

\paragraph{Buffers for Editing and for Running a Shell.}
Emacs provides facilities which go beyond ordinary text editing.  When
opening a file, Emacs can complete partially-typed file names by
referring to the typed directory.  The working copy of the opened file 
is placed in an Emacs buffer where it can be edited.  Buffers can be 
used for more than just editing text files; for instance, they can be 
used for controlling other programs or viewing the contents of a directory.  
Buffers allow the user to simultaneously edit multiple files and control 
multiple programs simply by switching between buffers.  Frequently an 
interactive command line interpreter, called an operating system shell, 
is run inside a buffer.

\paragraph{Emacs Modes.}
Emacs capabilities are extended by loading text files containing code
written in Emacs Lisp (elisp), a dialect of Lisp.  Emacs commands, 
written in elisp, can be called interactively by name or by their associated 
key-map.  Emacs functions are also written in elisp, but they can only be 
called by Emacs commands or other Emacs functions rather than by
name or key-maps.  The most important extensions to Emacs are the RAD
environments which are called modes.  Major-modes provide two kinds of support.  

First, they provide a customized environment (key-maps, commands, and menus) 
for specific file types.  Only 
one major-mode can be active for a given buffer at any time.  The major-mode 
is often determined by the file name extension, i.e. the characters at the 
end of the file name that follow a period like \stexttt{txt}, \stexttt{R} or
\stexttt{sas}.  Examples of this kind of major-mode are \stexttt{ESS[S]} and 
\stexttt{ESS[SAS]} (technically, both are special cases of \stexttt{ess-mode}).

Second, they provide the ability to run other programs.
In this case, the other program's standard input can be drawn from a buffer
or a file and its standard output can be directed to a buffer or a
file.  Buffers of this kind can control programs that transfer files
over a network, perform version control operations or many other
tasks.  An important example of this kind of major-mode is
\stexttt{shell-mode}.  ESS uses this type of major-mode to run a shell
inside a buffer to control statistical packages.  When a program is running 
in a shell inside a buffer, the entire transcript of the interaction can 
be searched, edited, saved and replayed.

Minor-modes, by contrast, provide services that are not mutually
exclusive.  This includes emulation of another editor or cooperating
with a version control program.  For example, the minor-mode
\stexttt{font-lock-mode} allows Emacs to highlight, with fonts or
colors, the syntax of a programming language whose characteristics are
described by a major-mode like \stexttt{ESS[SAS]}.  Remote editing of files is
provided by minor-modes \stexttt{ange-ftp} and \stexttt{EFS} for
non-secure access via ftp or \stexttt{tramp} for secure connections
with scp or ssh, and telnet for non-secure connections.
Interacting with revision control programs is provided by the minor-mode 
\stexttt{vc-mode} for packages like CVS, RCS and SCCS (or the more
specialized \stexttt{pcl-cvs-mode} for CVS which cooperates with 
\stexttt{vc-mode}).

\paragraph{Extensions to Editing.}
Most programming and documentation tasks fall under the realm of text
editing.  This work can be enhanced by modes which provide features such
as contextual highlighting and recognition of special reserved words
appropriate to the programming language in use.  
Emacs shares many features with word processing
programs and cooperates with document preparation systems
such as \LaTeX\ for typesetting or \textsc{html} and \textsc{xml}
for hypertext markup.  Other extensions to Emacs allow it to act as a 
web browser, a mail and news reader, and as an interface to
other common text-based tools such as spell checking programs.  The
Emacs key-maps can be re-configured to resemble other text editors, 
such as vi and brief.


\section{ESS extends Emacs}
\label{sec:ess-extends-emacs}

Emacs' RAD features make it a fine starting choice to
build an interface for statistical analysis packages.  ESS extends
Emacs to provide a functional and extensible interface
for multiple statistical packages. 
ESS most strongly supports the S family (S, \Splus, and R), \SAS\ and BUGS.  
\Stata\ and \XLispStat\ (and its extensions, ARC and ViSta) are
also supported.

\paragraph{Syntactic indentation and color/font-based source code
  highlighting.}  The ESS interface includes a description of the
syntax of each statistical language it supports.
The process of programming is enhanced as ESS provides the user with
syntax highlighting of language constructs such as reserved words,
function calls, strings, and comments.  ESS allows the user to specify
the increment of indentation and each new line is indented
to the same level as the previous line.

\paragraph{Code execution.}
ESS can send individual lines, marked regions, or whole buffers to a 
statistical analysis package for execution.  ESS sends the code to
the statistical package and receives the results in an Emacs buffer.  
ESS allows the code to be executed on a remote computer over the network 
with the same simplicity.  
%The remote machine can be a different platform than the local machine.

\paragraph{Conflicts in key-maps.}
Simple conflicts between interfaces are exemplified by different
key-maps for editing tasks such as cut, copy, paste, beginning of
line, end of line, etc.  These may be the most aggravating
because our fingers act without our brains consciously
thinking about it.  Differences in interfaces
circumvent this learned behavior.  ESS, as part of Emacs, 
solves this problem by providing a single key-map interface.

\section{Discussion}
\label{sec:discussion}

ESS is one of the first RADs intended for statisticians.  It provides
an enhanced, powerful interface for efficient interactive data
analysis and statistical programming.  It is completely customizable
to satisfy individual desires for interface styles as well as being
extensible to additional statistical languages and analysis packages.

\end{document}


%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End: