The R Project SVN R

Rev

Rev 7133 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7133 Rev 7192
Line 1... Line 1...
1
R FAQ
1
R FAQ
2
Frequently Asked Questions on R
2
Frequently Asked Questions on R
3
Version 0.90-4, 1999/11/13
3
Version 0.90-5, 1999/12/22
4
Kurt Hornik
4
Kurt Hornik
5
 
5
 
6
 
6
 
7
Table of Contents
7
Table of Contents
8
*****************
8
*****************
Line 202... Line 202...
202
   The current stable Unix/Windows version is 0.90.1, the unstable one is
202
   The current stable Unix/Windows version is 0.90.1, the unstable one is
203
0.99.0.  Typically, new features are introduced in the development
203
0.99.0.  Typically, new features are introduced in the development
204
versions; updates of stable versions are for bug fixes mostly.  The version
204
versions; updates of stable versions are for bug fixes mostly.  The version
205
for the Mac is pre-alpha.
205
for the Mac is pre-alpha.
206
 
206
 
-
 
207
   The release of version 1.0 is scheduled for February 29, 2000.
-
 
208
 
207
2.4 How can R be obtained?
209
2.4 How can R be obtained?
208
==========================
210
==========================
209
 
211
 
210
   Sources, binaries and documentation for R can be obtained via CRAN, the
212
   Sources, binaries and documentation for R can be obtained via CRAN, the
211
"Comprehensive R Archive Network" (see *Note What is CRAN?::).
213
"Comprehensive R Archive Network" (see *Note What is CRAN?::).
Line 240... Line 242...
240
font-end called `R' are created and copied to the `bin' directory.  You can
242
font-end called `R' are created and copied to the `bin' directory.  You can
241
copy the script to a place where users can invoke it, for example to
243
copy the script to a place where users can invoke it, for example to
242
`/usr/local/bin'.  In addition, plain text help pages as well as HTML and
244
`/usr/local/bin'.  In addition, plain text help pages as well as HTML and
243
LaTeX versions of the documentation are built.
245
LaTeX versions of the documentation are built.
244
 
246
 
245
   Use `make dvi' to obtain a dvi version of the R manual.  This creates
247
   Use `make dvi' to create dvi versions of the R manuals, such as
246
the files `Manual.dvi' (a start of a manual) and `Reference.dvi' (an R
248
`refman.dvi' (an R object reference index) and `R-exts.dvi', the "R
247
object reference index) in the `doc/manual' subdirectory.  These files can
249
Extension Writers Guide", in the `doc/manual' subdirectory.  These files
248
be previewed and printed using standard programs such as `xdvi' and `dvips'.
250
can be previewed and printed using standard programs such as `xdvi' and
-
 
251
`dvips'.  You can also use `make pdf' to build PDF (Portable Document
-
 
252
Format) version of the manuals, and view these using Acrobat.  Manuals
249
(Note that they have to be built in the source tree.)
253
written in the GNU Texinfo system can also be converted to info files
-
 
254
suitable for reading online with Emacs or standalone GNU Info; use `make
-
 
255
info' to create these versions.
250
 
256
 
251
   Finally, use `make check' to find out whether your R system works
257
   Finally, use `make check' to find out whether your R system works
252
correctly.
258
correctly.
253
 
259
 
254
   You can also perform a "system-wide" installation using `make install'.
260
   You can also perform a "system-wide" installation using `make install'.
Line 270... Line 276...
270
     $ ./configure --prefix=/where/you/want/R/to/go
276
     $ ./configure --prefix=/where/you/want/R/to/go
271
 
277
 
272
(E.g., the R executable will then be installed into
278
(E.g., the R executable will then be installed into
273
`/where/you/want/R/to/go/bin'.)
279
`/where/you/want/R/to/go/bin'.)
274
 
280
 
-
 
281
   To install dvi, info and PDF versions of the manuals, use `make
-
 
282
install-dvi', `make install-info' and `make install-pdf', respectively.
-
 
283
 
275
2.5.2 How can R be installed (Windows)
284
2.5.2 How can R be installed (Windows)
276
--------------------------------------
285
--------------------------------------
277
 
286
 
278
   The `bin/windows/windows-NT' directory of a CRAN site contains the
287
   The `bin/windows/windows-NT' directory of a CRAN site contains the
279
latest binary distributions of R for 32 bit versions of MS Windows (i.e.,
288
latest binary distributions of R for 32 bit versions of MS Windows (i.e.,
Line 320... Line 329...
320
exists, and can be printed on-screen by typing `help(NAME)' (or `?NAME') at
329
exists, and can be printed on-screen by typing `help(NAME)' (or `?NAME') at
321
the R prompt, where NAME is the name of the topic help is sought for.  (In
330
the R prompt, where NAME is the name of the topic help is sought for.  (In
322
the case of unary and binary operators and control-flow special forms, the
331
the case of unary and binary operators and control-flow special forms, the
323
name may need to be be quoted.)
332
name may need to be be quoted.)
324
 
333
 
325
   This documentation can also be made available as HTML, and as hardcopy
334
   This documentation can also be made available as one reference manual
-
 
335
for on-line reading in HTML and PDF formats, and as hardcopy via LaTeX, see
326
via LaTeX, see *Note How can R be installed?::.  An up-to-date HTML version
336
*Note How can R be installed?::.  An up-to-date HTML version is always
327
is always available for web browsing at `http://stat.ethz.ch/R/manual/'.
337
available for web browsing at `http://stat.ethz.ch/R/manual/'.
328
 
338
 
329
   An earlier attempt at an R manual ("Notes on R:  A Programming
339
   Currently, three further R manuals are being written:
-
 
340
 
-
 
341
   * "An Introduction to R" (`R-intro') includes information on data types,
-
 
342
     programming elements, statistical modelling and graphics.  This
330
Environment for Data Analysis and Graphics"), based on the "Notes on
343
     document is based on the "Notes on S-PLUS" by Bill Venables
331
S-PLUS" by Bill Venables <venables@stats.adelaide.edu.au> and David Smith
344
     <venables@stats.adelaide.edu.au> and David Smith
-
 
345
     <D.M.Smith@lancaster.ac.uk>.
-
 
346
 
-
 
347
   * "R Language Definition" (`R-lang') is the "Kernighan & Ritchie of R",
332
<D.M.Smith@lancaster.ac.uk>, can be obtained as `Rnotes.tgz' (LaTeX source)
348
     explaining evaluation, parsing, object oriented programming, computing
-
 
349
     on the language, and so forth.
-
 
350
 
-
 
351
   * "Writing R Extensions" (`R-exts') currently desribes the process of
333
in a CRAN `doc' directory.  Further documentation on R and the R API are
352
     creating R add-on packages, writing R documentation, and R's system
-
 
353
     and foreign language interfaces, and will soon also contain
334
currently being written.
354
     information on R's APIs.
-
 
355
 
-
 
356
The "R Extension Writers Guide" already comes with R, the other two will be
-
 
357
available for the 1.0 release.
335
 
358
 
336
   In the absence of an R manual, documentation for S/S-PLUS (see *Note R
359
   In addition to material written specifically for R, documentation for
337
and S::) can be used in combination with this FAQ (*note What are the
360
S/S-PLUS (see *Note R and S::) can be used in combination with this FAQ
338
differences between R and S?::).  We recommend
361
(*note What are the differences between R and S?::).  We recommend
339
 
362
 
340
     W. N. Venables and B. D. Ripley (1999), "Modern Applied Statistics with
363
     W. N. Venables and B. D. Ripley (1999), "Modern Applied Statistics with
341
     S-PLUS.  Third Edition".  Springer, ISBN 0-387-98825-4.
364
     S-PLUS.  Third Edition".  Springer, ISBN 0-387-98825-4.
342
 
365
 
343
which has a home page at `http://www.stats.ox.ac.uk/pub/MASS3/' providing
366
which has a home page at `http://www.stats.ox.ac.uk/pub/MASS3/' providing
Line 400... Line 423...
400
Note that the r-announce list is gatewayed into r-help, so you don't need
423
Note that the r-announce list is gatewayed into r-help, so you don't need
401
to subscribe to both of them.
424
to subscribe to both of them.
402
 
425
 
403
   Send email to <r-help@lists.r-project.org> to reach everyone on the
426
   Send email to <r-help@lists.r-project.org> to reach everyone on the
404
r-help mailing list.  To subscribe (or unsubscribe) to this list send
427
r-help mailing list.  To subscribe (or unsubscribe) to this list send
405
`subscribe' (or `unsubscribe') in the BODY of the message (not in the
428
`subscribe' (or `unsubscribe') in the _body_ of the message (not in the
406
subject!)  to <r-help-request@lists.r-project.org>.  Information about the
429
subject!) to <r-help-request@lists.r-project.org>.  Information about the
407
list can be obtained by sending an email with `info' as its contents to
430
list can be obtained by sending an email with `info' as its contents to
408
<r-help-request@lists.r-project.org>.
431
<r-help-request@lists.r-project.org>.
409
 
432
 
410
   Subscription and posting to the other lists is done analogously, with
433
   Subscription and posting to the other lists is done analogously, with
411
`r-help' replaced by `r-announce' and `r-devel', respectively.
434
`r-help' replaced by `r-announce' and `r-devel', respectively.
Line 435... Line 458...
435
which carry identical material, consisting of the R distribution(s), the
458
which carry identical material, consisting of the R distribution(s), the
436
contributed extensions, documentation for R, and binaries.
459
contributed extensions, documentation for R, and binaries.
437
 
460
 
438
   The CRAN master site can be found at the URL
461
   The CRAN master site can be found at the URL
439
 
462
 
440
     `http://cran.r-project.org/'                (Austria)
463
     `http://cran.r-project.org/'     (Austria)
441
 
464
 
442
(which is the same as `http://cran.at.r-project.org/') and is currently
465
(which is the same as `http://cran.at.r-project.org/') and is currently
443
being mirrored daily at
466
being mirrored daily at
444
 
467
 
445
     `http://cran.dk.r-project.org/'             (Denmark)
468
     `http://cran.dk.r-project.org/'  (Denmark)
446
     `http://cran.it.r-project.org/'             (Italy)
469
     `http://cran.it.r-project.org/'  (Italy)
447
     `http://cran.ch.r-project.org/'             (Switzerland)
470
     `http://cran.ch.r-project.org/'  (Switzerland)
448
     `http://cran.uk.r-project.org/'             (United Kingdom)
471
     `http://cran.uk.r-project.org/'  (United Kingdom)
449
     `http://cran.us.r-project.org/'             (USA/Wisconsin)
472
     `http://cran.us.r-project.org/'  (USA/Wisconsin)
450
 
473
 
451
Please use the CRAN site closest to you to reduce network load.
474
Please use the CRAN site closest to you to reduce network load.
452
 
475
 
453
   From CRAN, you can obtain the latest official release of R, daily
476
   From CRAN, you can obtain the latest official release of R, daily
454
snapshots of R (copies of the current CVS trees), as gzipped and bzipped
477
snapshots of R (copies of the current CVS trees), as gzipped and bzipped
455
tar files or as two gzipped tar files (ready for 1.4M floppies), a wealth
478
tar files or as two gzipped tar files (ready for 1.4M floppies), a wealth
456
of additional contributed code, as well as prebuilt binaries for various
479
of additional contributed code, as well as prebuilt binaries for various
457
operating systems (Linux, Nextstep, MacOS, MSWin) and pre-formatted help
480
operating systems (Linux, Digital Unix, and MS Windows) and pre-formatted
458
pages.  CRAN also provides access to documentation on R, existing mailing
481
help pages.  CRAN also provides access to documentation on R, existing
459
lists and the R Bug Tracking system.
482
mailing lists and the R Bug Tracking system.
460
 
483
 
461
   To "submit" to CRAN, simply upload to
484
   To "submit" to CRAN, simply upload to
462
`ftp://cran.r-project.org/incoming' and send an email to
485
`ftp://cran.r-project.org/incoming' and send an email to
463
<wwwadmin@cran.r-project.org>.
486
<wwwadmin@cran.r-project.org>.
464
 
487
 
Line 888... Line 911...
888
All of the Rweb versions can analyze Web accessible datasets if a URL is
911
All of the Rweb versions can analyze Web accessible datasets if a URL is
889
provided.
912
provided.
890
 
913
 
891
   A paper on Rweb, providing a detailed explanation of the different
914
   A paper on Rweb, providing a detailed explanation of the different
892
versions of Rweb and an overview of how Rweb works, was published in the
915
versions of Rweb and an overview of how Rweb works, was published in the
-
 
916
Journal of Statistical Software
893
Journal of Statistical Software (`http://www.stat.ucla.edu/journals/jss/').
917
(`http://www.stat.ucla.edu/journals/jss/v04/i01').
894
 
918
 
895
5 R Add-On Packages
919
5 R Add-On Packages
896
*******************
920
*******************
897
 
921
 
898
5.1 Which add-on packages exist for R?
922
5.1 Which add-on packages exist for R?
Line 934... Line 958...
934
     Functions for kernel smoothing (and density estimation) corresponding
958
     Functions for kernel smoothing (and density estimation) corresponding
935
     to the book "Kernel Smoothing" by M. P. Wand and M. C. Jones, 1995.
959
     to the book "Kernel Smoothing" by M. P. Wand and M. C. Jones, 1995.
936
 
960
 
937
*MASS*
961
*MASS*
938
     Functions and datasets from the main library of Venables and Ripley,
962
     Functions and datasets from the main library of Venables and Ripley,
939
     "Modern Applied Statistics with S-PLUS".  Contained in `VR'.
963
     "Modern Applied Statistics with S-PLUS".  Contained in the `VR' bundle.
940
 
964
 
941
*NISTnls*
965
*NISTnls*
942
     A set of test nonlinear least squares examples from NIST, the U.S.
966
     A set of test nonlinear least squares examples from NIST, the U.S.
943
     National Institute for Standards and Technology.
967
     National Institute for Standards and Technology.
944
 
968
 
Line 982... Line 1006...
982
*chron*
1006
*chron*
983
     A package for working with chronological objects (times and dates).
1007
     A package for working with chronological objects (times and dates).
984
 
1008
 
985
*class*
1009
*class*
986
     Functions for classification (k-nearest neighbor and LVQ).  Contained
1010
     Functions for classification (k-nearest neighbor and LVQ).  Contained
987
     in `VR'.
1011
     in the `VR' bundle.
988
 
1012
 
989
*cluster*
1013
*cluster*
990
     Functions for cluster analysis.
1014
     Functions for cluster analysis.
991
 
1015
 
992
*coda*
1016
*coda*
Line 1002... Line 1026...
1002
     vector of input dates in any of the forms `8/30/53', `30Aug53', `30
1026
     vector of input dates in any of the forms `8/30/53', `30Aug53', `30
1003
     August 1953', ..., `August 30 53', or any mixture of these.
1027
     August 1953', ..., `August 30 53', or any mixture of these.
1004
 
1028
 
1005
*e1071*
1029
*e1071*
1006
     Miscellaneous functions used at the Department of Statistics at TU Wien
1030
     Miscellaneous functions used at the Department of Statistics at TU Wien
1007
     (E1071).
1031
     (E1071), including moments, short-time Fourier transforms, Independent
-
 
1032
     Component Analysis, and simulation of a Wiener process.
1008
 
1033
 
1009
*fracdiff*
1034
*fracdiff*
1010
     Maximum likelihood estimation of the parameters of a fractionally
1035
     Maximum likelihood estimation of the parameters of a fractionally
1011
     differenced ARIMA(p,d,q) model (Haslett and Raftery, Applied
1036
     differenced ARIMA(p,d,q) model (Haslett and Raftery, Applied
1012
     Statistics, 1989).
1037
     Statistics, 1989).
Line 1067... Line 1092...
1067
*nlme*
1092
*nlme*
1068
     Fit and compare Gaussian linear and nonlinear mixed-effects models.
1093
     Fit and compare Gaussian linear and nonlinear mixed-effects models.
1069
 
1094
 
1070
*nnet*
1095
*nnet*
1071
     Software for single hidden layer perceptrons ("feed-forward neural
1096
     Software for single hidden layer perceptrons ("feed-forward neural
1072
     networks"), and for multinomial log-linear models.  Contained in `VR'.
1097
     networks"), and for multinomial log-linear models.  Contained in the
-
 
1098
     `VR' bundle.
1073
 
1099
 
1074
*norm*
1100
*norm*
1075
     Analysis of multivariate normal datasets with missing values.
1101
     Analysis of multivariate normal datasets with missing values.
1076
 
1102
 
1077
*oz*
1103
*oz*
Line 1116... Line 1142...
1116
     Bowman and A. Azzalini (1997), Oxford University Press.
1142
     Bowman and A. Azzalini (1997), Oxford University Press.
1117
 
1143
 
1118
*spatial*
1144
*spatial*
1119
     Functions for kriging and point pattern analysis from "Modern Applied
1145
     Functions for kriging and point pattern analysis from "Modern Applied
1120
     Statistics with S-PLUS" by W. Venables and B. Ripley.  Contained in
1146
     Statistics with S-PLUS" by W. Venables and B. Ripley.  Contained in
1121
     `VR'.
1147
     the `VR' bundle.
1122
 
1148
 
1123
*stable*
1149
*stable*
1124
     Density, distribution, quantile and hazard functions of a stable
1150
     Density, distribution, quantile and hazard functions of a stable
1125
     variate; generalized linear models for the parameters of a stable
1151
     variate; generalized linear models for the parameters of a stable
1126
     distribution.
1152
     distribution.
1127
 
1153
 
1128
*stataread*
1154
*stataread*
1129
     Read and write Stata v6 `.dta' files.
1155
     Read and write Stata v6 `.dta' files.
1130
 
1156
 
1131
*survival5*
1157
*survival5*
1132
     Functions for survival analysis, version 5 (requires *splines* and
1158
     Functions for survival analysis, version 5 (suggests *date*), the main
1133
     suggests *date*), the main new feature being penalised (partial)
1159
     new feature being penalised (partial) likelihood.
1134
     likelihood.
-
 
1135
 
1160
 
1136
*tree*
1161
*tree*
1137
     Classification and regression trees.
1162
     Classification and regression trees.
1138
 
1163
 
1139
*tripack*
1164
*tripack*
Line 1153... Line 1178...
1153
   There is also a CRAN `src/contrib/Devel' directory which contains
1178
   There is also a CRAN `src/contrib/Devel' directory which contains
1154
packages still "under development" or depending on features only present in
1179
packages still "under development" or depending on features only present in
1155
the current development versions of R.  Volunteers are invited to give
1180
the current development versions of R.  Volunteers are invited to give
1156
these a try, of course.  This area of CRAN currently contains
1181
these a try, of course.  This area of CRAN currently contains
1157
 
1182
 
1158
*bats*
-
 
1159
     Basic time series modelling functions.
-
 
1160
 
-
 
1161
*dopt*
1183
*dopt*
1162
     Finding D-optimal experimental designs.
1184
     Finding D-optimal experimental designs.
1163
 
1185
 
-
 
1186
*foreign*
-
 
1187
     Functions for reading data stored by statistical software like Minitab,
-
 
1188
     SAS, SPSS, etc.
-
 
1189
 
1164
*tcltk*
1190
*tcltk*
1165
     Basic interface with Tcl/Tk.
1191
     Basic interface with Tcl/Tk.
1166
 
1192
 
1167
*timeslab*
1193
*timeslab*
1168
     Time series routines.
1194
     Time series routines.
Line 1202... Line 1228...
1202
 
1228
 
1203
5.2 How can add-on packages be installed?
1229
5.2 How can add-on packages be installed?
1204
=========================================
1230
=========================================
1205
 
1231
 
1206
   (Unix only.)  The add-on packages on CRAN come as gzipped tar files
1232
   (Unix only.)  The add-on packages on CRAN come as gzipped tar files
1207
(which may contain more than one package).  First "unpack" the files of
1233
named `PKG_VERSION.tar.gz', which may in fact be "bundles" containing more
1208
interest.  If you have GNU tar, you can use `tar zxf NAME', otherwise you
1234
than one package.  Provided that `tar' and `gzip' are available on your
1209
can use `gunzip -c NAME | tar xf -'.
1235
system, type
1210
 
-
 
1211
   Let PKGDIR_1, ..., PKGDIR_N be the (relative or absolute) path names of
-
 
1212
the packages to be installed.  (In the simplest case, the unpacking creates
-
 
1213
a single package directory, and its name is used.)  To install to the
-
 
1214
default R directory tree (the `library' subdirectory of `R_HOME'), type
-
 
1215
 
1236
 
1216
     $ R INSTALL PKGDIR_1 ... PKGDIR_N
1237
     $ R INSTALL /path/to/PKG_VERSION.tar.gz
1217
 
1238
 
1218
at the shell prompt.  To install to another tree (e.g., your private one),
1239
at the shell prompt to install to the default R directory tree (the
-
 
1240
`library' subdirectory of `R_HOME').  To install to another tree (e.g.,
1219
use
1241
your private one), use
1220
 
1242
 
1221
     $ R INSTALL -l LIB PKGDIR_1 ... PKGDIR_N
1243
     $ R INSTALL -l LIB /path/to/PKG_VERSION.tar.gz
1222
 
1244
 
1223
where LIB gives the path to the library tree to install to.
1245
where LIB gives the path to the library tree to install to.
1224
 
1246
 
1225
   As of R version 0.65.1, you no longer need to explicitly unpack for
1247
   Even more conveniently, you can install and automatically update
1226
installing; i.e., you can do `R INSTALL /path/to/pkg_ver.tar.gz'.
1248
packages from within R if you have access to CRAN.  See the documentation
-
 
1249
for `CRAN.packages()' for more information.
1227
 
1250
 
1228
   You can use several library trees of add-on packages.  The easiest way
1251
   You can use several library trees of add-on packages.  The easiest way
1229
to tell R to use these is via the environment variable `R_LIBS' which
1252
to tell R to use these is via the environment variable `R_LIBS' which
1230
should be a colon-separated list of directories at which R library trees
1253
should be a colon-separated list of directories at which R library trees
1231
are rooted.  You do not have to specify the default tree in `R_LIBS'.
1254
are rooted.  You do not have to specify the default tree in `R_LIBS'.
Line 1259... Line 1282...
1259
     cluster      Functions for clustering
1282
     cluster      Functions for clustering
1260
     ctest        Classical tests
1283
     ctest        Classical tests
1261
     date         Functions for handling dates
1284
     date         Functions for handling dates
1262
     eda          Exploratory Data Analysis
1285
     eda          Exploratory Data Analysis
1263
     gee          Generalized Estimating Equation models
1286
     gee          Generalized Estimating Equation models
1264
     lme          Linear mixed effects library
-
 
1265
     locfit       Local regression, likelihood and density estimation
1287
     locfit       Local regression, likelihood and density estimation
1266
     lqs          Resistant regression and covariance estimation
1288
     lqs          Resistant regression and covariance estimation
1267
     modreg       Modern regression: smoothing and local methods
1289
     modreg       Modern regression: smoothing and local methods
1268
     mva          Classical Multivariate Analysis
1290
     mva          Classical Multivariate Analysis
-
 
1291
     nlme         Gaussian linear and nonlinear mixed-effects models
1269
     nls          Nonlinear regression
1292
     nls          Nonlinear regression
1270
     nnet         Software for feed-forward neural networks with a single
1293
     nnet         Software for feed-forward neural networks with a single
1271
                  hidden layer and for multinomial log-linear models.
1294
                  hidden layer and for multinomial log-linear models.
1272
     splines      Regression spline functions and classes
1295
     splines      Regression spline functions and classes
1273
     stepfun      Step functions, including empirical distributions
1296
     stepfun      Step functions, including empirical distributions
Line 1344... Line 1367...
1344
`.First.lib()' to load compiled code.
1367
`.First.lib()' to load compiled code.
1345
 
1368
 
1346
   The `man' subdirectory should contain documentation files for the
1369
   The `man' subdirectory should contain documentation files for the
1347
objects in the package.  The documentation files to be installed must also
1370
objects in the package.  The documentation files to be installed must also
1348
start with a (lower- or uppercase) letter and have the extension `.Rd' (the
1371
start with a (lower- or uppercase) letter and have the extension `.Rd' (the
1349
default) or `.rd'.
1372
default) or `.rd', and are written in the R documentation format (*note
-
 
1373
Writing R docs: (R-exts)Writing R documentation.)
1350
 
1374
 
1351
   C or FORTRAN source and optionally a `Makefile' for the compiled code is
1375
   C or FORTRAN source and optionally a `Makefile' for the compiled code is
1352
in `src'.  Note that the `Makefile' most likely is not needed.
1376
in `src'.  Note that the `Makefile' most likely is not needed.
1353
 
1377
 
1354
   The `data' subdirectory is for additional data files the package makes
1378
   The `data' subdirectory is for additional data files the package makes
Line 1369... Line 1393...
1369
for configuration before installation (such as checking for additional
1393
for configuration before installation (such as checking for additional
1370
software that might be needed by the package), and removing the files
1394
software that might be needed by the package), and removing the files
1371
created in this process.  See the add-on package *e1071* on CRAN for an
1395
created in this process.  See the add-on package *e1071* on CRAN for an
1372
example of this mechanism.
1396
example of this mechanism.
1373
 
1397
 
1374
   See the documentation for `library()' for more information.
1398
   *Note Creating R pkgs: (R-exts)Creating R packages, for more information.
1375
 
1399
 
1376
   The web page `http://www.biostat.washington.edu/~thomas/Rlib.html'
1400
   The web page `http://www.biostat.washington.edu/~thomas/Rlib.html'
1377
maintained by Thomas Lumley provides information on porting S packages to R.
1401
maintained by Thomas Lumley provides information on porting S packages to R.
1378
 
1402
 
1379
   *Note What is CRAN?::, for information on uploading a package to CRAN.
1403
   *Note What is CRAN?::, for information on uploading a package to CRAN.
Line 1411... Line 1435...
1411
   There is an Emacs package which provides a standard interface between
1435
   There is an Emacs package which provides a standard interface between
1412
statistical programs and statistical processes called ESS ("Emacs Speaks
1436
statistical programs and statistical processes called ESS ("Emacs Speaks
1413
Statistics").  It is intended to provide assistance for interactive
1437
Statistics").  It is intended to provide assistance for interactive
1414
statistical programming and data analysis.  Languages supported include: S
1438
statistical programming and data analysis.  Languages supported include: S
1415
dialects (S 3/4, S-PLUS 3.x/4.x/5.x, and R), LispStat dialects (XLispStat,
1439
dialects (S 3/4, S-PLUS 3.x/4.x/5.x, and R), LispStat dialects (XLispStat,
1416
ViSta), SAS, Stata, SPSS dialects (SPSS, Fiasco) and SCA.
1440
ViSta), SAS, Stata, SPSS dialects (SPSS, PSPP) and SCA.
1417
 
1441
 
1418
   ESS grew out of the desire for bug fixes and extensions to S-mode 4.8
1442
   ESS grew out of the desire for bug fixes and extensions to S-mode 4.8
1419
(which was a GNU Emacs interface to S/S-PLUS version 3 only).  The current
1443
(which was a GNU Emacs interface to S/S-PLUS version 3 only).  The current
1420
set of developers desired support for XEmacs, R, S4, and MS Windows.  In
1444
set of developers desired support for XEmacs, R, S4, and MS Windows.  In
1421
addition, with new modes being developed for R, Stata, and SAS, it was felt
1445
addition, with new modes being developed for R, Stata, and SAS, it was felt
Line 1475... Line 1499...
1475
 
1499
 
1476
6.3 Debugging R from within Emacs
1500
6.3 Debugging R from within Emacs
1477
=================================
1501
=================================
1478
 
1502
 
1479
   To debug R "from within Emacs", there are several possibilities.  To use
1503
   To debug R "from within Emacs", there are several possibilities.  To use
-
 
1504
the Emacs GUD (Grand Unified Debugger) library with the recommended
1480
GUD mode, type `M-x gdb' and give the path to the R _binary_, typically
1505
debugger GDB, type `M-x gdb' and give the path to the R _binary_, typically
1481
`R.X11', as argument.  At the gdb prompt, set `R_HOME' and other
1506
`R.X11', as argument.  At the gdb prompt, set `R_HOME' and other
1482
environment variables as needed (using e.g.  `set env R_HOME /path/to/R/',
1507
environment variables as needed (using e.g.  `set env R_HOME /path/to/R/',
1483
but see also below), and start the binary with the desired arguments (e.g.,
1508
but see also below), and start the binary with the desired arguments (e.g.,
1484
`r --vsize 12M').
1509
`run --vsize 12M').
1485
 
1510
 
1486
   If you have ESS, you can do `C-u M-x R<RET>-d gdb' to start an inferior
1511
   If you have ESS, you can do `C-u M-x R<RET>-d gdb' to start an inferior
1487
R process with arguments `-d gdb'.
1512
R process with arguments `-d gdb'.
1488
 
1513
 
1489
   A third option is to start an inferior R process via ESS (`M-x R') and
1514
   A third option is to start an inferior R process via ESS (`M-x R') and
Line 1495... Line 1520...
1495
facilities, such as object-name completion, that we know and love.
1520
facilities, such as object-name completion, that we know and love.
1496
 
1521
 
1497
   When using GUD mode for debugging from within Emacs, you may find it
1522
   When using GUD mode for debugging from within Emacs, you may find it
1498
most convenient to use the directory with your code in it as the current
1523
most convenient to use the directory with your code in it as the current
1499
working directory and then make a symbolic link from that directory to the
1524
working directory and then make a symbolic link from that directory to the
1500
R executable.  That way `.gdbinit' can stay in the directory with the code
1525
R binary.  That way `.gdbinit' can stay in the directory with the code and
1501
and be used to set up the environment and the search paths for the source,
1526
be used to set up the environment and the search paths for the source, e.g.
1502
e.g. as follows:
1527
as follows:
1503
 
1528
 
1504
     set env R_HOME /opt/R
1529
     set env R_HOME /opt/R
1505
     set env R_PAPERSIZE letter
1530
     set env R_PAPERSIZE letter
1506
     set env R_PRINTCMD lpr
1531
     set env R_PRINTCMD lpr
1507
     dir /opt/R/src/appl
1532
     dir /opt/R/src/appl
Line 1862... Line 1887...
1862
==================
1887
==================
1863
 
1888
 
1864
   If R executes an illegal instruction, or dies with an operating system
1889
   If R executes an illegal instruction, or dies with an operating system
1865
error message that indicates a problem in the program (as opposed to
1890
error message that indicates a problem in the program (as opposed to
1866
something like "disk full"), then it is certainly a bug.  If you call
1891
something like "disk full"), then it is certainly a bug.  If you call
1867
`.Internal()', `.External()', `.C()' or `.Fortran()' yourself (or in a
1892
`.C()', `.Fortran()', `.External()' or `.Call()' (or `.Internal()')
1868
function you wrote), you can always crash R by using wrong argument types
1893
yourself (or in a function you wrote), you can always crash R by using
1869
(modes).  This is not a bug.
1894
wrong argument types (modes).  This is not a bug.
1870
 
1895
 
1871
   Taking forever to complete a command can be a bug, but you must make
1896
   Taking forever to complete a command can be a bug, but you must make
1872
certain that it was really R's fault.  Some commands simply take a long
1897
certain that it was really R's fault.  Some commands simply take a long
1873
time.  If the input was such that you _know_ it should have been processed
1898
time.  If the input was such that you _know_ it should have been processed
1874
quickly, report a bug.  If you don't know whether the command should take a
1899
quickly, report a bug.  If you don't know whether the command should take a