1 %% Slides given at S-PLUS Users Conference, October 1997, by RMH.
3 \documentclass[12pt
]{article
} %latex2e
4 \usepackage{slverb
} %latex2e
5 %\documentstyle[12pt]{article} %latex 2.09
7 % Warning: do not compress blanks into tabs.
8 % It will destroy the spacing in the S functions in the Example environment.
10 %\newfont{\sltt}{cmsltt10 scaled\magstep3} % load slant tt font Large
11 \newfont{\sltt}{cmsltt10 scaled
\magstep5} % load slant tt font Huge %duplicate for Huge
12 \newfont{\slttH}{cmsltt10 scaled
\magstep5} % load slant tt font Huge
13 \newfont{\ttHuge}{cmtt12 scaled
\magstep4} % load tt font Huge
14 \newfont{\itHuge}{cmti12 scaled
\magstep4} % load italic font Huge
16 \newcommand{\LB}{{\tt\char'
173}} % \tt {
17 \newcommand{\RB}{{\tt\char'
175}} % \tt }
18 \newcommand{\BS}{{\tt\char'
134}} % \tt \
19 \newcommand{\HH}{{\tt\char'
043}} % \tt #
20 %\newcommand{\slLB}{{\sltt\char'173}} % \sltt {
21 %\newcommand{\slRB}{{\sltt\char'175}} % \sltt }
22 %\newcommand{\slBS}{{\sltt\char'134}} % \sltt \
23 %\newcommand{\slHH}{{\sltt\char'043}} % \sltt #
24 \newcommand{\slLBH}{{\slttH\char'
173}} % \slttH {
25 \newcommand{\slRBH}{{\slttH\char'
175}} % \slttH }
26 \newcommand{\slBSH}{{\slttH\char'
134}} % \slttH \
27 \newcommand{\slHHH}{{\slttH\char'
043}} % \slttH #
28 % These commands give the stated character in the correct font in LaTeX.
29 % Beware of spacing in the "Example" environment, where spaces are significant:
30 % "\LB{}contents\RB" produces "{contents}"
31 % "\LB contents \RB" produces "{ contents }"
34 \newcommand{\hlinefill}{\mbox{\rule{0pt
}{1ex
}}\hrulefill}
49 \newcommand{\la}{{\rm\Huge$
\leftarrow$
}}
51 \newcommand{\mc}[1]{\multicolumn{2}{l
}{#1}}
52 \newcommand{\marpar}[1]{\marginpar{\raggedright#1}}
53 \newcommand{\Twiddle}{$
\sim$
}
56 %\newenvironment{exsf}{\begin{list}{}{\setlength{\leftmargin}{\parindent}}\item[]\small\sf}{\end{list}}
59 %\newenvironment{exsf}{\begin{list}{}{\setlength{\leftmargin}{\parindent}}\item[]\small\sf\boldmath}{\end{list}}
62 \newenvironment{exsf
}{\begin{list
}{}{\setlength{\leftmargin}{\parindent}}\item[]\sf\boldmath}{\end{list
}}
64 \newcommand{\s}[1]{\mbox{\protect\small\sf#1}}
65 \newcommand{\msf}[1]{\mbox{\tiny\sf #1}}
66 \newcommand{\msm}[1]{\mbox{\scriptsize$
#1$
}}
68 %\renewcommand{\topfraction}{1.}
69 %\renewcommand{\bottomfraction}{0.}
70 %\renewcommand{\textfraction}{0.}
71 %\renewcommand{\floatpagefraction}{1.}
72 %\renewcommand{\floatsep}{0pt}
73 %\renewcommand{\textfloatsep}{0pt}
74 %\setcounter{topnumber}{25}
75 %\setcounter{bottomnumber}{0}
76 %\setcounter{totalnumber}{25}
78 %\renewcommand{\dbltopfraction}{1.}
79 %\renewcommand{\dblfloatpagefraction}{1.}
80 %\renewcommand{\dblfloatsep}{0pt}
81 %\renewcommand{\dbltextfloatsep}{0pt}
82 %\setcounter{dbltopnumber}{25}
84 \newcommand{\shortspace}{
85 \setlength{\topsep}{0in
}
86 \setlength{\itemsep}{0in
}
87 \setlength{\parsep}{0in
}
88 \setlength{\parskip}{0in
}
99 Richard M. Heiberger\\
[1ex
]
100 based on joint work with\\
101 A.J. Rossini(U South Carolina),\\
102 Kurt Hornik(TU-Wien), and Martin Maechler (ETHZ).\\
[2ex
]
104 Doug Bates, Ed Kademan, Frank Ritter (initial versions),\\
105 and David Smith (
3.x,
4.x)\\
[3ex
]
107 Richard M. Heiberger\\
[.4ex
]
108 Temple University\\
[.4ex
]
109 Philadelphia, PA
19122-
2585\\
[.4ex
]
110 {\sf rmh@astro.ocis.temple.edu
}\\
[2ex
]
111 S-PLUS Users Conference, Seattle, October
1997
116 \begin{center
}Abstract
\end{center
}
117 ESS
[Emacs Speaks Statistics
] (formerly S-mode) is a a GNU Emacs
118 package for running S(plus), R, X-LispStat, SAS and potentially other
119 interactive `statistical' languages in an `inferior' buffer, editing
120 source code in these languages and interacting with the running
121 program. This talk will discuss the capabilities and advantages of
122 using ESS as the primary interface to Splus.
125 I am talking about the version which will be released in November
1997
127 \hspace*
{2ex
}{\sf http://franz.stat.wisc.edu/pub/ESS/ESS-
5.0.tar.gz
}\\
128 \hspace*
{2ex
}{\sf ftp://franz.stat.wisc.edu/pub/ESS/ESS-
5.0.tar.gz
}\\
129 The previous stable version was
4.8 in
130 {\sf S-mode-
4.8.MM6.XE2.tar.gz
}
140 Why should I use ESS-mode with S-Plus
142 Other features in ESS-mode
149 The best, most expressive, most fun, most powerful environment and
150 program for designing methods for statistical analysis of data and for
151 displaying and analyzing data.
157 A text editor that is fully configurable and extensible, can work with
158 many files simultaneously, interacts with the computer operating
159 system and other executing processes, has language specific
160 customizations, and can indeed do anything (the previous edition
161 iconized to the Kitchen Sink).
163 In addition to S, Emacs has modes designed for
\TeX,
\LaTeX, fortran,
164 c, lisp, text, directories, telnet, rlogin, terminal emulators, nroff,
165 pascal, c++, ada, asm, etc.
167 Mode customizations include indentation patterns, syntactic
168 highlighting, comment structure, and interaction with the program that
169 uses the file as input.
175 A package written in emacs which is designed to work with Statistical
176 software. The initial development under the name S-mode was designed
177 for S. It has been extended to dialects of S (S-Plus, S4, R) and now
178 to other statistical packages (SAS, Xlispstat). With the extension
179 came the name change to ESS-mode (Emacs Speaks Statistics).
181 There are three primary components to ESS
183 \item [S-mode
] for editing
{\tt myfile.s
} and submitting individual
184 lines and paragraphs of S code to the running S process.
185 \item [inferior-ess-mode
] for executing an S process inside an emacs buffer.
186 \item [S-transcript-mode
] for reviewing and possibly re-executing the
187 transcript of a previous S process.
192 Why should I use ESS-mode with S-Plus?
194 It will improve your productivity.
198 {\bf S-mode.
} Automatic syntactic indentation and highlighting of source
202 \underline{\slttH \slHHH\slHHH as typed -- too long. Line is folded
}\\
203 {\tt case0701 <- read.table(file=
{\slttH'case0701.asc'
}, header
\BS} \\
204 {\tt =
\underline{T
})
}\\
207 \underline{\slttH{\slHHH\slHHH insert line break, syntactic indentation lost
}}\\
208 \tt{case0701 <- read.table(file=
{\slttH'case0701.asc'
},
}\\
209 \tt{header=
\underline{T
})
}\\
212 \underline{\slttH{\slHHH\slHHH automatic indentation at right parenthesis level
}}\\
213 \tt{case0701 <- read.table(file=
{\slttH'case0701.asc'
},
}\\
214 \tt\verb+ header=+
\underline{T
})\\
217 Here by font, on a terminal by
color.\\
218 \underline{\slttH{\slHHH\slHHH comments
}}~~~~~~~
{\rm underlined italic
}\\
219 {\slttH"quoted strings"
}~
{\rm italic
}\\
220 \underline{keywords
}~~~~~~~~~
{\rm underlined
}
225 {\bf S-mode.
} Fill-paragraph understands comments.
228 Too long and folded.\\
229 \underline{\slttH\slHHH\slHHH~Sometimes statements are complicated with many
}\BS\\
230 \underline{\slttH levels of
}\\
231 \underline{\slttH\slHHH\slHHH~ parentheses. ESS gets the indentation right.
}
234 Fill-paragraph broke lines evenly and generated the comment symbols.\\
235 \underline{\slttH\slHHH\slHHH~Sometimes statements are complicated with
}\\
236 \underline{\slttH\slHHH\slHHH~many levels of parentheses. ESS gets the
}\\
237 \underline{\slttH\slHHH\slHHH~indentation right.
}
240 {\bf S-mode.
} Detects unbalanced parentheses
243 \underline{\slttH\slHHH\slHHH~Complicated statement
}
245 {\
\tt if ((abs(end(x) + tspar(x)
["deltat"
] - start(y))
}\\
246 {\
\tt \hspace*
{3em
}< eps) \&\&
}\\
247 {\
\tt \hspace*
{2.5em
}(frequency(x) == frequency(y)) \&\&
}\\
248 {\
\tt \hspace*
{2.5em
}\fbox{\slttH(
}(length(units(x))==
0) ||
}\\
249 {\
\tt \hspace*
{3em
}(length(units(y))==
0) ||
}\\
250 {\
\tt \hspace*
{3em
}(units(x) == units(y))
\fbox{\slttH]})
}
254 On a
color display screen the unbalanced parentheses are bright purple.
259 Syntactic highlighting simplifies detection of unbalanced\\
262 {\tt tmp <- f(x,
{\slttH"this is a string, y, z)
}}
268 {\bf inferior-ess-mode.
} Evaluating lines of S source
270 Program statements and function definitions
271 can be developed in an editing window that is
272 NOT the same as the executing S process.
274 The lines are sent to S with keyboard
281 lm( y ~ x, data=mydata)
284 --**-Emacs: test.s (ESS
[S
] [none
])--L1--All------
287 > lm( y ~ x, data=mydata)
288 Error: Object "mydata" not found
293 --**-Emacs: *S+
3:
1* (iESS
[S+
3:
1]: run)--L6--All--
299 Errors are corrected in the editing window and resent.
301 Errors are corrected in the editing window and resent.
307 lm( y ~ x, data=myrealdata)
310 --**-Emacs: test.s (ESS
[S
] [none
])--L1--All------
313 > lm( y ~ x, data=mydata)
314 Error: Object "mydata" not found
316 > lm( y ~ x, data=myrealdata)
320 --**-Emacs: *S+
3:
1* (iESS
[S+
3:
1]: run)--L6--All--
324 The corrected
{\tt test.s
} is now a permanent record of the
325 commands that are needed.
327 This form of interaction between the editing process and the S
328 execution is usually the best way to develop a set of functions.
331 {\bf inferior-ess-mode.
} The session file is always available.
333 The entire S session is in a buffer and can be be searched, edited,
334 reviewed, saved during the current session. Previous results never
335 run off the top of the screen and are never subject to arbitrary line
338 The buffer containing the S session transcript can be saved as a file.
339 The file can be revisited later for editing into a
report or handout.
340 The file can be brought back into a buffer in S-transcript-mode and used as
341 the base for further development.
344 {\bf S-transcript-mode.
} The transcript of a previous S session can
345 be brought back and used as model for further development. When the
346 cursor is placed on any line of a multi-line command, the entire
347 command can be sent over
348 to any relevant active inferior S-process with a single keystroke.
351 > xyplot(data ~ voltage | power, data=time.powers,
352 + scales=list(y=list(relation="free")),
353 + ylab="powers of time",
354 + main="case0802 ladder of powers")
358 Once the command works correctly, it can be cleaned mechanically with
359 the
{\tt ess-transcript-clean-region
} function.
362 xyplot(data ~ voltage | power, data=time.powers,
363 scales=list(y=list(relation="free")),
364 ylab="powers of time",
365 main="case0802 ladder of powers")
370 Other features in ESS-mode
373 \item Help files go to their own buffer. Many can be viewed simultaneously.
374 \item Several different instantiations of the same or different dialects of S (or other
375 statistical program) can be controlled simultaneously through the same emacs process.
376 \item Multiple S source files can be developed simultaneously.
377 \item ESS-mode recognizes functions, multi-line statements,
378 highlighted regions, parenthetical expressions.
379 \item When an error is detected in a source file, ESS switches the display to the file and
380 places the cursor on the line where the error was detected.
381 \item Object-name-completion.