ESS[SAS]: somebody forgot about the SUM statement (probably me)
[ess.git] / doc / inst_tar.texi
blob56b9af7bcde3de0eb6c886afe3922e8a71bab4d3
2 @node Unix installation, Microsoft Windows installation, , Installation
3 @comment  node-name,  next,  previous,  up
4 @section Unix installation
6 @enumerate
8 @item
10 @code{cd} to a directory where you keep emacs lisp files, or create a
11 new directory (for example, @file{$HOME/emacs}) to hold the distribution.
12 This directory will be referred to below as "the ESS distribution
13 directory".  
15 @emph{Note for XEmacs packages:} ESS is no longer available as an XEmacs package.  
16 But, you can still install ESS into the XEmacs package system by choosing
17 @file{ESSDIR}=@file{PREFIX/lib/xemacs/site-packages}.
18 ESS requires that the XEmacs sumo tarball (all XEmacs packages combined) also
19 be installed.  For information on installing XEmacs packages, follow this link: 
20 @uref{http://www.xemacs.org/Documentation/packageGuide.html, Quickstart Package Guide}.
22 @comment It will contain,
23 @comment at the end, the tar file @file{ess-VERSION.tar.gz}, and a directory for
24 @comment the ESS source, which will be termed "the ESS-VERSION source directory".
25 @comment Note that the .elc files may be installed elsewhere (as specified in the
26 @comment Makefile) if desired.
28 @item
29 Retrieve the latest version from
30 @uref{http://ess.r-project.org/downloads/ess, ESS downloads area}
31 to @file{ESSDIR}.
33 @item
34 Extract the files from the disribution.
35 @display
36 If you are using GNU tar, @code{tar zxf ess-VERSION.tgz}.
37 Otherwise, @code{gunzip < ess-VERSION.tgz | tar xf -},
38 @end display
40 The @code{tar} command will create the subdirectory @file{ess-VERSION} and install
41 the files there.
43 @comment If you are using GNU Emacs 19.29, decompress/unarchive
44 @comment @file{ESSDIR/ess-VERSION/lisp/19.29.tar.gz},
45 @comment read @file{ESSDIR/ess-VERSION/lisp/19.29/README}, follow the instructions
46 @comment and you might be able to get ESS to work.
47 @comment @emph{Please note that GNU Emacs 19.29 is no longer supported}.
48 @comment For a list of supported versions of emacs, see @xref{Requirements}.
50 @item
51 Edit the file @file{ESSDIR/ess-VERSION/lisp/ess-site.el} as explained in the
52 comments section of that file.
53 @comment Installations that are using ESS only for S-Plus
54 @comment 6.x will probably not need to make any changes.  Installations that also
55 @comment have one or more of (S4, S+3/4/5/6/7/8, R, SAS, BUGS, XLispStat, Stata)
56 @comment may need to uncomment corresponding lines in @file{ESSDIR/ess-VERSION/lisp/ess-site.el}.
58 @item
59 If you are using GNU Emacs add the line
60 @example
61 (load "ESSDIR/ess-VERSION/lisp/ess-site")
62 @end example
63 to @file{$HOME/.emacs}.  For XEmacs, if you followed the XEmacs package system
64 installation advice, add the line
65 @example
66 (require 'ess-site)
67 @end example
68 to @file{$HOME/.xemacs/init.el}.  Otherwise, for XEmacs, add the line
69 @example
70 (load "ESSDIR/ess-VERSION/lisp/ess-site")
71 @end example
72 to @file{$HOME/.xemacs/init.el}.  
73   
74 @comment GNU Emacs uses @file{default.el} or
75 @comment @file{site-init.el} and XEmacs uses @file{site-start.el} for the system
76 @comment installation file).
77 @comment Alternatively, if @file{ess-site.el} is in your current @code{load-path}, then:
78 @comment @example
79 @comment (require 'ess-site)
80 @comment @end example
81 @comment to configure emacs for ESS.
83 @item
84 That's it!  ESS is now ready to use.  (The remaining step below is only for a
85 custom installation.)  To edit statistical programs, just open files with the
86 requisite extensions (@file{.R} for R, @file{.sas} for SAS, @file{.bug} for BUGS,
87 etc.).  To start a statistical process within emacs, such as R, type @code{M-x R}.
89 @c @item
90 @c (OPTIONAL) If you are running S-PLUS or R, you might consider
91 @c installing the database files.  From within emacs, @code{C-x d} to the
92 @c directory containing ESS.  Now:
93 @c @example
94 @c M-x S+6
95 @c @end example
96 @c to get S running.  Once you see the SPLUS prompt, do:
97 @c @example
98 @c M-x ess-create-object-name-db
99 @c @end example
100 @c (this will create the file @file{ess-sp6-namedb.el}; if it isn't in the
101 @c ESS directory, move it there).
103 @c Then, completions will be autoloaded and will not be regenerated for
104 @c every session.
106 @c For R, do the same, using
107 @c @example
108 @c M-x R
109 @c @end example
110 @c and then @code{M-x ess-create-object-name-db} creating
111 @c @file{ess-r-namedb.el}; if it isn't in the ESS directory, move it there).
113 @item
114 @b{(OPTIONAL) READ THIS ITEM THOROUGHLY BEFORE STARTING}:
116 If you want to place the compiled files in other locations edit the
117 @code{LISPDIR}, @code{INFODIR} and @code{ETCDIR} entries in Section 1 of
118 @file{Makeconf} in the @file{ESSDIR/ess-VERSION} directory (if you are
119 using XEmacs, then uncomment the XEmacs subsection in Section 1).
121 You can compile those files by:
122 @example
123 make all
124 @end example
126 When that completes successfully, install the compiled files:
127 @example
128 make install
129 @end example
131 @c This will install the compiled info files and lisp files.  If you are an
132 @c XEmacs user, then you should be done.  If not, then you may have to
133 @c edit/create the file @file{dir} that is found in the directory specified
134 @c by @code{INFODIR}: see the sample @file{dir} in ESSDIR/ess-VERSION/doc/info.
135 @c If @file{dir} does not exist in @code{INFODIR}, then the sample
136 @c @file{dir} will be installed.
139 @comment An alternative, if you are running XEmacs and have access to the
140 @comment XEmacs system directories, would be to place the directory in the
141 @comment site-lisp directory, and simply type @code{make all} (and copy the
142 @comment documentation as appropriate).
143 @comment
144 @comment For GNU Emacs, you would still have to move the files into the top level
145 @comment site-lisp directory.
147 @end enumerate
149 @c >>>> FIXME (see comment in ess.texi): error in ``makeinfo readme.texi''
150 @c @node Microsoft Windows installation, , Unix installation, Installation
151 @node Microsoft Windows installation, Requirements, Unix installation, Installation
152 @comment  node-name,  next,  previous,  up
153 @section Microsoft Windows installation
155 For @b{Microsoft Windows installation}, please follow the next steps.
157 @enumerate
159 @item
160 @code{cd} to a directory where you keep emacs lisp files, or create a
161 new directory (for example, @file{c:\emacs\}) to hold the distribution.
162 This directory will be referred to below as "the ESS distribution
163 directory".  
165 @emph{Note for XEmacs packages:} ESS is no longer available as an XEmacs
166 package. But, you can still install ESS into the XEmacs package system
167 by choosing @file{ESSDIR}=@file{PREFIX\XEmacs\site-packages}.  ESS
168 requires that the XEmacs sumo tarball (all XEmacs packages combined)
169 also be installed.  For information on installing XEmacs packages,
170 follow this link:
171 @uref{http://www.xemacs.org/Documentation/packageGuide.html, Quickstart
172 Package Guide}.
174 @item
175 Retrieve the latest zip file (@file{ess-VERSION.zip}) from
176 @uref{http://ess.r-project.org/downloads/ess, ESS downloads area} and
177 store it in the ESS distribution directory.  Be aware that http browsers
178 on Windows frequently change the "." and "-" characters in filenames to
179 other punctuation.  Please change the names back to their original form.
181 @item
182 Extract all the files from @file{ess-VERSION.zip} into the ESS
183 distribution directory as @file{c:\emacs\ess-VERSION\}.  (It is possible
184 to unpack the zip archive in Windows Explorer by double clicking on the
185 folder; you should then see a new folder called @file{ess-VERSION}.
186 Drag that folder into your ESS distribution directory.)
188 @comment @item
189 @comment Add the line
190 @comment @example
191 @comment (load "C:/emacs/ess-VERSION/lisp/ess-site")
192 @comment @end example
193 @comment to your emacs initialization file.  (GNU Emacs uses the filename
194 @comment @file{~/.emacs} and XEmacs uses the filename
195 @comment @file{~/.xemacs/init.el} for the initialization file.  The tilde is
196 @comment recognised by emacs as your HOME directory, i.e. the value of your HOME
197 @comment environment variable.)  Replace
198 @comment @code{VERSION} above with the version number of ESS.  Remember to use
199 @comment forwardslashes @code{/}, rather than backslashes @code{\}, in your filename
200 @comment inside emacs code files.
202 @item
203 If you are using GNU Emacs add the line
204 @example
205 (load "ESSDIR/ess-VERSION/lisp/ess-site")
206 @end example
207 to @file{%HOME%/.emacs}.  For XEmacs, if you followed the XEmacs package system
208 installation advice, add the line
209 @example
210 (require 'ess-site)
211 @end example
212 to @file{%HOME%/.xemacs/init.el}.  Otherwise, for XEmacs, add the line
213 @example
214 (load "ESSDIR/ess-VERSION/lisp/ess-site")
215 @end example
216 to @file{%HOME%/.xemacs/init.el}.  
217 @emph{Note:} Both GNU Emacs and XEmacs require that the HOME environment
218 variable be set on your system, otherwise, your initialization file will
219 not be utilized, and therefore, ESS will not work.
221 After saving your initialization file, ESS is now installed.  Start a
222 new emacs and you should be ready to use ESS.  For example, to edit
223 statistical programs, load the files with the requisite extensions
224 (".sas" for SAS, ".S" or "s" or "q" or "Q" for S-PLUS, ".r" or ".R" for
225 R, and ".lsp" for XLispStat).  One further step is needed if you wish to
226 run statistical processes, see below.
228 @item
229 To run statistical processes under ESS, Windows users will need to make
230 sure that the directories for the software they will be using is in the
231 PATH environment variable.  On Windows 9x, add lines similar to the
232 following to your @file{c:\autoexec.bat} file:
233 @example
234 path=%PATH%;c:\progra~1\insightful\splus70\cmd
235 @end example
236 On Windows NT/2000/XP, add the directories to the PATH using the
237 @code{My Computer/Control Panel/System/Advanced/Environment Variables} menu.
238 Note that the directory containing the program is
239 added to the PATH, not the program itself.  One such line is needed
240 for each software program.  Be sure to use the abbreviation
241 @code{progra~1} and not the long version with embedded blanks.  Use
242 backslashes "@code{\}".
244 An alternative, for R users, is that rather than adjusting the PATH
245 variable, you can add the following to your emacs initialization file
246 (and restart emacs):
247 @example
248 (setq inferior-R-program-name "C:/progra~1/R/R-2.2.1/bin/Rterm.exe")
249 @end example
250 This assumes that you have installed R-2.2.1 in the default location.
251 Change the path otherwise to point to other locations.
253 Windows users who place S-PLUS anywhere other than the default
254 location will also need to add the following three lines (properly
255 adjusted for their location) to their @file{%HOME%/.emacs} or
256 @file{%HOME%/.xemacs/init.el} file:
257 @example
258 (setq-default inferior-S+6-program-name
259     "c:/progra~1/Insightful/SPLUS70/cmd/Splus")
260 (setq-default inferior-Sqpe+6-SHOME-name
261     "c:/progra~1/Insightful/SPLUS70")
262 (setq-default inferior-Sqpe+6-program-name
263     "c:/progra~1/Insightful/SPLUS70/cmd/Sqpe.exe")
264 @end example
265 The above example uses the default location of S-PLUS in
266 @code{c:/progra~1/Insightful}.  Please note that ESS
267 considers S-PLUS 6, 7, and 8 to be variants of S+6.
269 These users may also need to modify the emacs variable @code{ess-SHOME-versions}
270 to match their installation in order to get the full set of S-PLUS versions
271 on their machine into the @code{ESS} menu.
273 To start the S-PLUS [678].x GUI from ESS under emacs:
274 @enumerate
275 @item
276 If you use Cygwin bash as your primary shell, then
277 @example
278 M-x S
279 (or @code{M-x S+6}).
280 @end example
281 @item
282 If you use the MSDOS prompt window as your primary shell, then
283 @example
284 M-x S+6-msdos
285 @end example
286 @end enumerate
287 You will then be
288 asked for a pathname ("S starting data directory?"), from which to
289 start the process.  The prompt will propose your current directory
290 as the default.  ESS will start the S-PLUS GUI.  There will be
291 slight delay during which emacs is temporarily frozen.  ESS will arrange for
292 communication with the S-PLUS GUI using the DDE protocol.
293 Send lines or regions
294 from the emacs buffer containing your S program (for example,
295 @file{myfile.s}) to the S-PLUS Commands Window with the
296 @code{C-c C-n} or @code{C-c C-r} keys.
297 (If you are still using S-PLUS 4.x or 2000,\
298 then use @code{M-x S+4} or @code{M-x S+4-msdos}.)
300 To start an S-PLUS [678].x session inside an emacs buffer---and
301 without the S-PLUS GUI:
302 @example
303 M-x Sqpe
304 (or @code{M-x Sqpe+6}).
305 @end example
306 This works with both the bash and msdos shells.
307 You will then be asked for a pathname ("S starting data
308 directory?"), from which to start the process.  The prompt will
309 propose your current directory as the default.
310 You get Unix-like behavior, in particular the entire
311 transcript is available for emacs-style search commands.
312 Send lines or regions from the emacs buffer containing your S
313 program (for example, @file{myfile.s}) to the *S+6* buffer with the
314 @code{C-c C-n} or @code{C-c C-r} keys.
315 Interactive graphics are available with Sqpe by using the java
316 library supplied with S-PLUS 6.1 and newer releases.
317 Enter the commands:
318 @example
319 library(winjava)
320 java.graph()
321 @end example
322 Graphs can be saved from the @code{java.graph} device
323 in several formats, but not PostScript.   If you
324 need a PostScript file you will need to open a separate
325 @code{postscript} device.
326 (If you are still using S-PLUS 4.x or 2000, then use @code{M-x Sqpe+4}.)
328 To connect to an already running S-PLUS GUI (started, for example,
329 from the S-PLUS icon):
330 @example
331 M-x S+6-existing
332 @end example
334 @example
335 M-x S+6-msdos-existing
336 @end example
337 You will then be
338 asked for a pathname ("S starting data directory?"), from which to
339 start the process.  The prompt will propose your current directory
340 as the default.  ESS will arrange for
341 communication with the already running S-PLUS GUI using the DDE protocol.
342 Send lines or regions
343 from the emacs buffer containing your S program (for example,
344 @file{myfile.s}) to the S-PLUS Commands Window with the
345 @code{C-c C-n} or @code{C-c C-r} keys.
346 (If you are still using S-PLUS 4.x or 2000,
347  then use @code{M-x S+4-existing} or @code{M-x S+4-msdos-existing}.)
349 If you wish to run R, you can start it with:
350 @example
351 M-x R
352 @end example
354 XLispStat can not currently be run with
355 @example
356 M-x XLS
357 @end example
358 Hopefully, this will change.  However, you can still edit with
359 emacs, and cut and paste the results into the XLispStat
360 *Listener* Window under Microsoft Windows.
362 @comment SAS for Windows uses the batch access with function keys that is
363 @comment described in
364 @comment @file{doc/README.SAS}.
365 @comment @xref{ESS(SAS)--MS Windows}.
366 @comment The user can also edit SAS files
367 @comment in an @code{ESS[SAS]} buffer and than manually copy and paste them into
368 @comment an Editor window in the SAS Display Manager.
369 @comment
370 @comment For Windows, inferior SAS in an @code{iESS{[SAS]}} buffer does not work
371 @comment on the local machine.  It does work over a network connection to
372 @comment SAS running on a remote Unix computer.
373 @comment
374 @comment Reason:  we use ddeclient to interface with programs and SAS doesn't
375 @comment provide the corresponding ddeserver capability.
377 @c @item
378 @c (OPTIONAL) If you are running Sqpe or R, you might consider
379 @c installing the database files.  From within emacs, @code{C-x d} to
380 @c the   directory containing ESS.  Now:
381 @c @example
382 @c M-x Sqpe+6
383 @c @end example
384 @c to get S running.  Once you see the SPLUS prompt, do:
385 @c @example
386 @c M-x ess-create-object-name-db
387 @c @end example
388 @c (this will create the file @file{ess-s+6-namedb.el}; if it isn't in the
389 @c ESS directory, move it there).
391 @c Then, completions will be autoloaded and will not be regenerated
392 @c for every session.
394 @c For R, do the same, using
395 @c @example
396 @c M-x R
397 @c @end example
398 @c and then @code{M-x ess-create-object-name-db} creating
399 @c @file{ess-r-namedb.el}; if it isn't in the ESS directory, move it
400 @c there).
402 @item That's it!
404 @end enumerate
405 @comment Requirements duplicated?
406 @comment @node Requirements, , Microsoft Windows installation, Installation
407 @comment node-name,  next,  previous,  up
408 @comment @section Requirements
409 @comment @include requires.texi