The R Project SVN R

Rev

Rev 28070 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28070 Rev 28161
1
\input texinfo
1
\input texinfo
2
@c %**start of header
2
@c %**start of header
3
@setfilename rw-FAQ.info
3
@setfilename rw-FAQ.info
4
@settitle R for Windows FAQ
4
@settitle R for Windows FAQ
5
@setchapternewpage on
5
@setchapternewpage on
6
@set VERSION @RWVER@
6
@set VERSION @RWVER@
7
@set RVERSION @RVER@
7
@set RVERSION @RVER@
8
@c %**end of header
8
@c %**end of header
9
@documentlanguage en
9
@documentlanguage en
10
@documentencoding ISO-8859-1
10
@documentencoding ISO-8859-1
11
 
11
 
12
@finalout
12
@finalout
13
 
13
 
14
@macro newchap{}
14
@macro newchap{}
15
@ifinfo
15
@ifinfo
16
@sp 1
16
@sp 1
17
@end ifinfo
17
@end ifinfo
18
@ifhtml
18
@ifhtml
19
@html
19
@html
20
<hr>
20
<hr>
21
@end html
21
@end html
22
@end ifhtml
22
@end ifhtml
23
@end macro
23
@end macro
24
 
24
 
25
@titlepage
25
@titlepage
26
@title R for Windows FAQ
26
@title R for Windows FAQ
27
@subtitle Frequently Asked Questions on R for Windows
27
@subtitle Frequently Asked Questions on R for Windows
28
@subtitle Version @value{VERSION}
28
@subtitle Version @value{VERSION}
29
@author B. D. Ripley and D. J. Murdoch
29
@author B. D. Ripley and D. J. Murdoch
30
@end titlepage
30
@end titlepage
31
 
31
 
32
@ifinfo
32
@ifinfo
33
R for Windows FAQ                           @*
33
R for Windows FAQ                           @*
34
Frequently Asked Questions on R for Windows @*
34
Frequently Asked Questions on R for Windows @*
35
Version for @value{VERSION}                 @*
35
Version for @value{VERSION}                 @*
36
B. D. Ripley                                @*
36
B. D. Ripley                                @*
37
 
37
 
38
@sp 2
38
@sp 2
39
@end ifinfo
39
@end ifinfo
40
 
40
 
41
@ifhtml
41
@ifhtml
42
@html
42
@html
43
<h2>Version for <tt>@value{VERSION}</tt></h2>
43
<h2>Version for <tt>@value{VERSION}</tt></h2>
44
<address>B. D. Ripley</address>
44
<address>B. D. Ripley</address>
45
<hr>
45
<hr>
46
@end html
46
@end html
47
@end ifhtml
47
@end ifhtml
48
 
48
 
49
@paragraphindent 0
49
@paragraphindent 0
50
 
50
 
51
@contents
51
@contents
52
 
52
 
53
@ifinfo
53
@ifinfo
54
@sp 1
54
@sp 1
55
@end ifinfo
55
@end ifinfo
56
 
56
 
57
 
57
 
58
@node Top, Introduction, (dir), (dir)
58
@node Top, Introduction, (dir), (dir)
59
 
59
 
60
@menu
60
@menu
61
* Introduction::
61
* Introduction::
62
* Installation and Usage::
62
* Installation and Usage::
63
* Packages::
63
* Packages::
64
* Windows Features::
64
* Windows Features::
65
* Workspaces::
65
* Workspaces::
66
* The R Console and Fonts::
66
* The R Console and Fonts::
67
* Building from Source::
67
* Building from Source::
68
@end menu
68
@end menu
69
 
69
 
70
 
70
 
71
@newchap{}
71
@newchap{}
72
@node Introduction, Installation and Usage, Top, Top
72
@node Introduction, Installation and Usage, Top, Top
73
@chapter Introduction
73
@chapter Introduction
74
 
74
 
75
This FAQ is for the Windows port of R: it describes features specific to
75
This FAQ is for the Windows port of R: it describes features specific to
76
that version.  The main R FAQ can be found at
76
that version.  The main R FAQ can be found at
77
 
77
 
78
@display
78
@display
79
@uref{http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html}.
79
@uref{http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html}.
80
@end display
80
@end display
81
 
81
 
82
The information here applies only to recent versions of R for Windows,
82
The information here applies only to recent versions of R for Windows,
83
(@code{1.9.0} or later); the current version is often called something like
83
(@code{1.9.0} or later); the current version is often called something like
84
@code{@value{VERSION}} (although not officially).
84
@code{@value{VERSION}} (although not officially).
85
 
85
 
86
 
86
 
87
 
87
 
88
@newchap{}
88
@newchap{}
89
@node Installation and Usage, Packages, Introduction, Top
89
@node Installation and Usage, Packages, Introduction, Top
90
@chapter Installation and Usage
90
@chapter Installation and Usage
91
 
91
 
92
@menu
92
@menu
93
* Where can I find the latest version?::
93
* Where can I find the latest version?::
94
* How do I install R for Windows?::
94
* How do I install R for Windows?::
95
* Can I customize the installation?::
95
* Can I customize the installation?::
96
* How do I run it?::
96
* How do I run it?::
97
* How do I UNinstall R?::
97
* How do I UNinstall R?::
98
* What's the best way to upgrade?::
98
* What's the best way to upgrade?::
99
* There seems to be a limit on the memory it uses!::
99
* There seems to be a limit on the memory it uses!::
100
* How can I keep workspaces for different projects in different directories?::
100
* How can I keep workspaces for different projects in different directories?::
101
* How do I print from R?::
101
* How do I print from R?::
102
* Can I use R BATCH?::
102
* Can I use R BATCH?::
103
* Can I use @RWVER@ with ESS and (X)emacs?::
103
* Can I use @RWVER@ with ESS and (X)emacs?::
104
* What are HOME and working directories?::
104
* What are HOME and working directories?::
105
* How do I set environment variables?::
105
* How do I set environment variables?::
106
* R can't find my file::
106
* R can't find my file::
107
* Does R use the Registry?::
107
* Does R use the Registry?::
108
* Does R support automation?::
108
* Does R support automation?::
109
* The internet download functions fail.::
109
* The internet download functions fail.::
110
* Entering certain characters crashes Rgui.::
110
* Entering certain characters crashes Rgui.::
111
* Other strange crashes.::
111
* Other strange crashes.::
112
@end menu
112
@end menu
113
 
113
 
114
 
114
 
115
@node Where can I find the latest version?, How do I install R for Windows?, Installation and Usage, Installation and Usage
115
@node Where can I find the latest version?, How do I install R for Windows?, Installation and Usage, Installation and Usage
116
@section Where can I find the latest version?
116
@section Where can I find the latest version?
117
 
117
 
118
Go to any CRAN site (see @uref{http://cran.r-project.org/mirrors.html}
118
Go to any CRAN site (see @uref{http://cran.r-project.org/mirrors.html}
119
for a list), navigate to the @code{bin/windows/base}
119
for a list), navigate to the @code{bin/windows/base}
120
directory and collect the files you need.  There are two versions of
120
directory and collect the files you need.  There are two versions of
121
the distribution.
121
the distribution.
122
 
122
 
123
1) @code{@RWVER@.exe} is about 21Mb.  This contains all the components
123
1) @code{@RWVER@.exe} is about 21Mb.  This contains all the components
124
and allows as complete as installation as you choose.
124
and allows as complete as installation as you choose.
125
 
125
 
126
2) Directory @code{miniR} contains @code{miniR.exe} and eight files
126
2) Directory @code{miniR} contains @code{miniR.exe} and eight files
127
@code{miniR-?.bin}.  You can put @code{miniR.exe} and @code{miniR-1.bin}
127
@code{miniR-?.bin}.  You can put @code{miniR.exe} and @code{miniR-1.bin}
128
on one floppy and the remaining @code{miniR-?.bin} on a floppy each.
128
on one floppy and the remaining @code{miniR-?.bin} on a floppy each.
129
This is a small installation, containing the text and compiled HTML
129
This is a small installation, containing the text and compiled HTML
130
versions of the help files and the @emph{An Introduction to R} and
130
versions of the help files and the @emph{An Introduction to R} and
131
@emph{Data Import/Export} manuals in PDF.  There is no support for
131
@emph{Data Import/Export} manuals in PDF.  There is no support for
132
@code{tcltk} in this version.
132
@code{tcltk} in this version.
133
 
133
 
134
 
134
 
135
 
135
 
136
@node How do I install R for Windows?, Can I customize the installation?, Where can I find the latest version?, Installation and Usage
136
@node How do I install R for Windows?, Can I customize the installation?, Where can I find the latest version?, Installation and Usage
137
@section How do I install R for Windows?
137
@section How do I install R for Windows?
138
 
138
 
139
You need Windows 95/98/ME/NT4/2000/XP: Windows 3.11+win32s will not
139
You need Windows 95/98/ME/NT4/2000/XP: Windows 3.11+win32s will not
140
work.  Your file system must allow long file names (as is likely except
140
work.  Your file system must allow long file names (as is likely except
141
perhaps for some network-mounted systems).
141
perhaps for some network-mounted systems).
142
 
142
 
143
If you want to build packages from sources, we recommend that you choose
143
If you want to build packages from sources, we recommend that you choose
144
an installation path not containing spaces.  (Using a path with spaces
144
an installation path not containing spaces.  (Using a path with spaces
145
in will probably work, but is little-tested.)
145
in will probably work, but is little-tested.)
146
 
146
 
147
To use @code{@RWVER@.exe} or @code{miniR.exe}.  Just double-click on the
147
To use @code{@RWVER@.exe} or @code{miniR.exe}.  Just double-click on the
148
icon and follow the instructions.  If you installed R this way you can
148
icon and follow the instructions.  If you installed R this way you can
149
uninstall it from the Control Panel or Start Menu (unless you supressed
149
uninstall it from the Control Panel or Start Menu (unless you supressed
150
making a group for R).
150
making a group for R).
151
 
151
 
152
Choose a working directory for R.  If you installed manually, make a
152
Choose a working directory for R.  If you installed manually, make a
153
shortcut to @code{@RWVER@\bin\Rgui.exe} on your desktop or somewhere on
153
shortcut to @code{@RWVER@\bin\Rgui.exe} on your desktop or somewhere on
154
the Start menu file tree.  Right-click the shortcut, select
154
the Start menu file tree.  Right-click the shortcut, select
155
Properties... and change the `Start in' field to your working directory.
155
Properties... and change the `Start in' field to your working directory.
156
 
156
 
157
You may also want to add command-line arguments at the end of the Target
157
You may also want to add command-line arguments at the end of the Target
158
field (@emph{after} any final double quote), for example @code{--sdi
158
field (@emph{after} any final double quote), for example @code{--sdi
159
--max-mem-size=200M}.  You can also set environment variables at the end
159
--max-mem-size=200M}.  You can also set environment variables at the end
160
of the Target field, for example @code{R_LIBS=p:/myRlib}.
160
of the Target field, for example @code{R_LIBS=p:/myRlib}.
161
 
161
 
162
@node Can I customize the installation?, How do I run it?, How do I install R for Windows?, Installation and Usage
162
@node Can I customize the installation?, How do I run it?, How do I install R for Windows?, Installation and Usage
163
@section Can I customize the installation?
163
@section Can I customize the installation?
164
 
164
 
165
The normal way to customize the installation is by selecting components
165
The normal way to customize the installation is by selecting components
166
from the wizards shown.  However, sysadmins might like to install R from
166
from the wizards shown.  However, sysadmins might like to install R from
167
scripts, and the following command-line flags are available for use with
167
scripts, and the following command-line flags are available for use with
168
either installer.
168
either installer.
169
 
169
 
170
@table @samp
170
@table @samp
171
@item /SILENT
171
@item /SILENT
172
only show the installation progress window and error messages.
172
only show the installation progress window and error messages.
173
@item /VERYSILENT
173
@item /VERYSILENT
174
only show error messages.
174
only show error messages.
175
@item /DIR="x:\dirname"
175
@item /DIR="x:\dirname"
176
set the default installation directory
176
set the default installation directory
177
@item /GROUP="folder name"
177
@item /GROUP="folder name"
178
set the default Start-menu group name
178
set the default Start-menu group name
179
@item /COMPONENTS="comma separated list of component names"
179
@item /COMPONENTS="comma separated list of component names"
180
set the initial list of components.  This is only useful with
180
set the initial list of components.  This is only useful with
181
@code{@RWVER@.exe}, which has components @code{main}, @code{chtml},
181
@code{@RWVER@.exe}, which has components @code{main}, @code{chtml},
182
@code{html}, @code{latex}, @code{manuals}, @code{devel} and @code{tcl}.
182
@code{html}, @code{latex}, @code{manuals}, @code{devel} and @code{tcl}.
183
@end table
183
@end table
184
 
184
 
185
@noindent
185
@noindent
186
It is also possible to save the settings used to a file and later
186
It is also possible to save the settings used to a file and later
187
reload those settings using
187
reload those settings using
188
 
188
 
189
@table @samp
189
@table @samp
190
@item /SAVEINF="filename"
190
@item /SAVEINF="filename"
191
save the settings to the specified file.  Don't forget to use quotes if
191
save the settings to the specified file.  Don't forget to use quotes if
192
the filename contains spaces.
192
the filename contains spaces.
193
@item /LOADINF="filename"
193
@item /LOADINF="filename"
194
instructs the installer to load the settings from the specified file
194
instructs the installer to load the settings from the specified file
195
after having checked the command line.
195
after having checked the command line.
196
@end table
196
@end table
197
 
197
 
198
A successful installation has exit code 0: unsuccessful ones may give 1,
198
A successful installation has exit code 0: unsuccessful ones may give 1,
199
2, 3, 4 or 5.  See the help for Inno Setup 4
199
2, 3, 4 or 5.  See the help for Inno Setup 4
200
(@uref{http://jrsoftware.org/isinfo.php}) for details.
200
(@uref{http://jrsoftware.org/isinfo.php}) for details.
201
 
201
 
202
 
202
 
203
@node How do I run it?, How do I UNinstall R?, Can I customize the installation?, Installation and Usage
203
@node How do I run it?, How do I UNinstall R?, Can I customize the installation?, Installation and Usage
204
@section How do I run it?
204
@section How do I run it?
205
 
205
 
206
Just double-click on the shortcut you prepared at installation.
206
Just double-click on the shortcut you prepared at installation.
207
 
207
 
208
If you want to set up another project, make a new shortcut or use the
208
If you want to set up another project, make a new shortcut or use the
209
existing one and change the `Start in' field of the Properties.
209
existing one and change the `Start in' field of the Properties.
210
 
210
 
211
You may if you prefer run R from the command line of any shell you use,
211
You may if you prefer run R from the command line of any shell you use,
212
for example an `MS-DOS window' (Windows 9x/ME), a `Command Prompt'
212
for example an `MS-DOS window' (Windows 9x/ME), a `Command Prompt'
213
(Windows 2000/XP) or a port of a Unix shell such as @code{tcsh} or
213
(Windows 2000/XP) or a port of a Unix shell such as @code{tcsh} or
214
@code{bash}. (The command line can be anything you would put in the
214
@code{bash}. (The command line can be anything you would put in the
215
Target field of a shortcut, and the starting directory will be the
215
Target field of a shortcut, and the starting directory will be the
216
currect working directory of the shell.)
216
currect working directory of the shell.)
217
 
217
 
218
 
218
 
219
@node How do I UNinstall R?, What's the best way to upgrade?, How do I run it?, Installation and Usage
219
@node How do I UNinstall R?, What's the best way to upgrade?, How do I run it?, Installation and Usage
220
@section How do I UNinstall R?
220
@section How do I UNinstall R?
221
 
221
 
222
Normally you can do this from the R group on the Start Menu or from the
222
Normally you can do this from the R group on the Start Menu or from the
223
@code{Add/Remove Programs} in the Control Panel.  If it does not appear
223
@code{Add/Remove Programs} in the Control Panel.  If it does not appear
224
there or if you want to remove an old version, run @file{unins000.exe}
224
there or if you want to remove an old version, run @file{unins000.exe}
225
in the top-level installation directory.  (There should be a separate
225
in the top-level installation directory.  (There should be a separate
226
uninstall item in the R group for each installed version of R.)
226
uninstall item in the R group for each installed version of R.)
227
 
227
 
228
Uninstalling R only removes files from the initial installation, not
228
Uninstalling R only removes files from the initial installation, not
229
(for example) packages you have installed.
229
(for example) packages you have installed.
230
 
230
 
231
If all else fails, you can just delete the whole directory in which R
231
If all else fails, you can just delete the whole directory in which R
232
was installed.
232
was installed.
233
 
233
 
234
 
234
 
235
@node What's the best way to upgrade?, There seems to be a limit on the memory it uses!, How do I UNinstall R?, Installation and Usage
235
@node What's the best way to upgrade?, There seems to be a limit on the memory it uses!, How do I UNinstall R?, Installation and Usage
236
@section What's the best way to upgrade?
236
@section What's the best way to upgrade?
237
 
237
 
238
That's a matter of taste.  For most people the best thing to do is to
238
That's a matter of taste.  For most people the best thing to do is to
239
uninstall R (see the previous Q), install the new version, copy any
239
uninstall R (see the previous Q), install the new version, copy any
240
installed packages to the library folder in the new installation, run
240
installed packages to the library folder in the new installation, run
241
@code{update.packages()} in the new R (`Update packages from CRAN' from
241
@code{update.packages()} in the new R (`Update packages from CRAN' from
242
the Packages menu, if you prefer) and then delete anything left of the
242
the Packages menu, if you prefer) and then delete anything left of the
243
old installation.  Different versions of R are quite deliberately
243
old installation.  Different versions of R are quite deliberately
244
installed in parallel folders so you can keep old versions around if you
244
installed in parallel folders so you can keep old versions around if you
245
wish.
245
wish.
246
 
246
 
247
 
247
 
248
@node There seems to be a limit on the memory it uses!, How can I keep workspaces for different projects in different directories?, What's the best way to upgrade?, Installation and Usage
248
@node There seems to be a limit on the memory it uses!, How can I keep workspaces for different projects in different directories?, What's the best way to upgrade?, Installation and Usage
249
@section There seems to be a limit on the memory it uses!
249
@section There seems to be a limit on the memory it uses!
250
 
250
 
251
Indeed there is.  It is set by the command-line flag
251
Indeed there is.  It is set by the command-line flag
252
@option{--max-mem-size} (@pxref{How do I install R for Windows?}) and
252
@option{--max-mem-size} (@pxref{How do I install R for Windows?}) and
253
defaults to the smaller of the amount of physical RAM in the machine and
253
defaults to the smaller of the amount of physical RAM in the machine and
254
1Gb.  It can be set to any amount over 10M. (R will not run in less.)
254
1Gb.  It can be set to any amount over 10M. (R will not run in less.)
255
Be aware though that Windows has (in most versions) a maximum amount of
255
Be aware though that Windows has (in most versions) a maximum amount of
256
user virtual memory of 2Gb, and parts of this can be reserved by
256
user virtual memory of 2Gb, and parts of this can be reserved by
257
processes but not used.  The version of the memory manager used from R
257
processes but not used.  The version of the memory manager used from R
258
1.9.0 allocates large objects in their own memory areas and so is better
258
1.9.0 allocates large objects in their own memory areas and so is better
259
able to make use of fragmented virtual memory than that used from 1.2.0
259
able to make use of fragmented virtual memory than that used from 1.2.0
260
to 1.8.x.
260
to 1.8.x.
261
 
261
 
262
Use @code{?Memory} and @code{?memory.size} for information about memory
262
Use @code{?Memory} and @code{?memory.size} for information about memory
263
usage.  The limit can be raised by calling @code{memory.limit} within a
263
usage.  The limit can be raised by calling @code{memory.limit} within a
264
running R session.
264
running R session.
265
 
265
 
266
R can be compiled to use a different memory manager which might be better
266
R can be compiled to use a different memory manager which might be better
267
at using large amounts of memory, but is substantially slower (making R
267
at using large amounts of memory, but is substantially slower (making R
268
several times slower on some tasks).
268
several times slower on some tasks).
269
 
269
 
270
If you are running a version of Windows which supports more than 2Gb per
270
If you are running a version of Windows which supports more than 2Gb per
271
process, you can let the R executables use it by marking their headers
271
process, you can let the R executables use it by marking their headers
272
suitably.  If you have Visual Studio use
272
suitably.  If you have Visual Studio use
273
@smallexample
273
@smallexample
274
editbin /LARGEADDRESSAWARE \path\to\rwxxxx\bin\Rgui.exe
274
editbin /LARGEADDRESSAWARE \path\to\rwxxxx\bin\Rgui.exe
275
editbin /LARGEADDRESSAWARE \path\to\rwxxxx\bin\Rterm.exe
275
editbin /LARGEADDRESSAWARE \path\to\rwxxxx\bin\Rterm.exe
276
@end smallexample
276
@end smallexample
277
and check this by
277
and check this by
278
@smallexample
278
@smallexample
279
dumpbin /headers \path\to\rwxxxx\bin\Rgui.exe
279
dumpbin /headers \path\to\rwxxxx\bin\Rgui.exe
280
dumpbin /headers \path\to\rwxxxx\bin\Rterm.exe
280
dumpbin /headers \path\to\rwxxxx\bin\Rterm.exe
281
@end smallexample
281
@end smallexample
282
You should see a line like
282
You should see a line like
283
@smallexample
283
@smallexample
284
                   Application can handle large (>2GB) addresses
284
                   Application can handle large (>2GB) addresses
285
@end smallexample
285
@end smallexample
286
 
286
 
287
 
287
 
288
@node How can I keep workspaces for different projects in different directories?, How do I print from R?, There seems to be a limit on the memory it uses!, Installation and Usage
288
@node How can I keep workspaces for different projects in different directories?, How do I print from R?, There seems to be a limit on the memory it uses!, Installation and Usage
289
@section How can I keep workspaces for different projects in different directories?
289
@section How can I keep workspaces for different projects in different directories?
290
 
290
 
291
Create a separate shortcut for each project: see Q2.3.  All the paths to
291
Create a separate shortcut for each project: see Q2.3.  All the paths to
292
files used by R are relative to the starting directory, so setting the
292
files used by R are relative to the starting directory, so setting the
293
`Start in' field automatically helps separate projects.
293
`Start in' field automatically helps separate projects.
294
 
294
 
295
Alternatively, start R by double-clicking on a saved @file{.RData} file
295
Alternatively, start R by double-clicking on a saved @file{.RData} file
296
in the directory for the project you want to use, or drag-and-drop a
296
in the directory for the project you want to use, or drag-and-drop a
297
file with extension @file{.RData} onto an R shortcut.  In either case,
297
file with extension @file{.RData} onto an R shortcut.  In either case,
298
the working directory will be set to that containing the file.
298
the working directory will be set to that containing the file.
299
 
299
 
300
 
300
 
301
@node How do I print from R?, Can I use R BATCH?, How can I keep workspaces for different projects in different directories?, Installation and Usage
301
@node How do I print from R?, Can I use R BATCH?, How can I keep workspaces for different projects in different directories?, Installation and Usage
302
@section How do I print from R?
302
@section How do I print from R?
303
 
303
 
304
It depends what you want to print.
304
It depends what you want to print.
305
 
305
 
306
@itemize @bullet
306
@itemize @bullet
307
@item You can print the graphics window from its menu or by using
307
@item You can print the graphics window from its menu or by using
308
@code{dev.print} with suitable arguments (see its help page: most likely
308
@code{dev.print} with suitable arguments (see its help page: most likely
309
@code{dev.print(win.graph)} will work).
309
@code{dev.print(win.graph)} will work).
310
 
310
 
311
@item You can print from the R console or pager by @code{File | Print}.
311
@item You can print from the R console or pager by @code{File | Print}.
312
(This will print the selection if there is one, otherwise the whole
312
(This will print the selection if there is one, otherwise the whole
313
console or pager contents.)
313
console or pager contents.)
314
 
314
 
315
@item You can print help files from the pager or HTML browser.
315
@item You can print help files from the pager or HTML browser.
316
 
316
 
317
@item If you have configured @code{RHOME\bin\helpPRINT.bat} and have
317
@item If you have configured @code{RHOME\bin\helpPRINT.bat} and have
318
LaTeX installed you can print help files by @code{help(fn_name, offline=TRUE)}.
318
LaTeX installed you can print help files by @code{help(fn_name, offline=TRUE)}.
319
@end itemize
319
@end itemize
320
 
320
 
321
 
321
 
322
@node Can I use R BATCH?, Can I use @RWVER@ with ESS and (X)emacs?, How do I print from R?, Installation and Usage
322
@node Can I use R BATCH?, Can I use @RWVER@ with ESS and (X)emacs?, How do I print from R?, Installation and Usage
323
@section Can I use @code{R BATCH}?
323
@section Can I use @code{R BATCH}?
324
 
324
 
325
Yes.  The Windows analogue is @code{Rcmd BATCH}: use @code{Rcmd BATCH
325
Yes.  The Windows analogue is @code{Rcmd BATCH}: use @code{Rcmd BATCH
326
--help} for full details.  (Perl is no longer required.)
326
--help} for full details.  (Perl is no longer required.)
327
 
327
 
328
You can set also up a batch file using @code{Rterm.exe}.  A sample
328
You can set also up a batch file using @code{Rterm.exe}.  A sample
329
batch file might contain (as one line)
329
batch file might contain (as one line)
330
 
330
 
331
@example
331
@example
332
path_to_R\bin\Rterm.exe --no-restore --no-save < %1 > %1.out 2>&1
332
path_to_R\bin\Rterm.exe --no-restore --no-save < %1 > %1.out 2>&1
333
@end example
333
@end example
334
@noindent
334
@noindent
335
The purpose of @code{2>&1} is to redirect warnings and errors to the
335
The purpose of @code{2>&1} is to redirect warnings and errors to the
336
same file as normal output, and users of Windows 95/98/ME's default
336
same file as normal output, and users of Windows 95/98/ME's default
337
@code{command.com} `shell' will need to omit it. (That program has no
337
@code{command.com} `shell' will need to omit it. (That program has no
338
means to redirect @file{stderr}, and @code{Rterm.exe} sends warnings and
338
means to redirect @file{stderr}, and @code{Rterm.exe} sends warnings and
339
errors to the normal output file on such systems.)
339
errors to the normal output file on such systems.)
340
 
340
 
341
 
341
 
342
@node Can I use @RWVER@ with ESS and (X)emacs?, What are HOME and working directories?, Can I use R BATCH?, Installation and Usage
342
@node Can I use @RWVER@ with ESS and (X)emacs?, What are HOME and working directories?, Can I use R BATCH?, Installation and Usage
343
@section Can I use @RWVER@ with ESS and (X)emacs?
343
@section Can I use @RWVER@ with ESS and (X)emacs?
344
 
344
 
345
Yes.  Recent versions of ESS (e.g. 5.1.20) come with support for this
345
Yes.  Recent versions of ESS (e.g. 5.1.20) come with support for this
346
version of R, and there is support for interrupting the R process from
346
version of R, and there is support for interrupting the R process from
347
ESS (by @code{C-c C-c}).
347
ESS (by @code{C-c C-c}).
348
 
348
 
349
For help with ESS, please send email to @email{ESS-help@@stat.ethz.ch},
349
For help with ESS, please send email to @email{ESS-help@@stat.ethz.ch},
350
not the R mailing lists.
350
not the R mailing lists.
351
 
351
 
352
 
352
 
353
@node What are HOME and working directories?, How do I set environment variables?, Can I use @RWVER@ with ESS and (X)emacs?, Installation and Usage
353
@node What are HOME and working directories?, How do I set environment variables?, Can I use @RWVER@ with ESS and (X)emacs?, Installation and Usage
354
@section What are HOME and working directories?
354
@section What are HOME and working directories?
355
 
355
 
356
Several places in the documentation use these terms.
356
Several places in the documentation use these terms.
357
 
357
 
358
The working directory is the directory from which @code{Rgui} or
358
The working directory is the directory from which @code{Rgui} or
359
@code{Rterm} was launched, unless a shortcut was used when it is given
359
@code{Rterm} was launched, unless a shortcut was used when it is given
360
by the `Start in' field of the shortcut's properties.  You can find this
360
by the `Start in' field of the shortcut's properties.  You can find this
361
from R code by the call @code{getwd()}.
361
from R code by the call @code{getwd()}.
362
 
362
 
363
The home directory is set as follows:@*
363
The home directory is set as follows:@*
364
If environment variable @env{R_USER} is set, its value is used.@*
364
If environment variable @env{R_USER} is set, its value is used.@*
365
Otherwise if environment variable @env{HOME} is set, its value is used.@*
365
Otherwise if environment variable @env{HOME} is set, its value is used.@*
366
Otherwise if environment variables @env{HOMEDRIVE} and @env{HOMEPATH}
366
Otherwise if environment variables @env{HOMEDRIVE} and @env{HOMEPATH}
367
are set, the value is @code{$@{HOMEDRIVE@}$@{HOMEPATH@}}.@*
367
are set, the value is @code{$@{HOMEDRIVE@}$@{HOMEPATH@}}.@*
368
If all of these fail, the current working directory is used.
368
If all of these fail, the current working directory is used.
369
 
369
 
370
You can find this from R code by @code{Sys.getenv("R_USER")}.
370
You can find this from R code by @code{Sys.getenv("R_USER")}.
371
 
371
 
372
@node How do I set environment variables?, R can't find my file, What are HOME and working directories?, Installation and Usage
372
@node How do I set environment variables?, R can't find my file, What are HOME and working directories?, Installation and Usage
373
@section How do I set environment variables?
373
@section How do I set environment variables?
374
 
374
 
375
Environment variables can be set in R in three different ways.
375
Environment variables can be set in R in three different ways.
376
@enumerate
376
@enumerate
377
@item
377
@item
378
On the command line as name=value pairs.  For example in the shortcut to
378
On the command line as name=value pairs.  For example in the shortcut to
379
@code{RGui} you could have
379
@code{RGui} you could have
380
 
380
 
381
@example
381
@example
382
path_to_R\bin\Rgui.exe HOME=p:/ R_LIBS=p:/myRlib
382
path_to_R\bin\Rgui.exe HOME=p:/ R_LIBS=p:/myRlib
383
@end example
383
@end example
384
 
384
 
385
@item
385
@item
386
In an environment file @file{.Renviron} in the working directory
386
In an environment file @file{.Renviron} in the working directory
387
or your home directory, for example containing the line
387
or your home directory, for example containing the line
388
 
388
 
389
@example
389
@example
390
R_LIBS=p:/myRlib
390
R_LIBS=p:/myRlib
391
@end example
391
@end example
392
 
392
 
393
If you have permission to do so, you can also create an environment file
393
If you have permission to do so, you can also create an environment file
394
@file{etc\Renviron.site} and set environmental variables in that file in
394
@file{etc\Renviron.site} and set environmental variables in that file in
395
the same way.  This is useful for variables which should be set for all
395
the same way.  This is useful for variables which should be set for all
396
users and all usages of this R installation.  (Their values can be
396
users and all usages of this R installation.  (Their values can be
397
overridden in a @file{.Renviron} or on the command line.)
397
overridden in a @file{.Renviron} or on the command line.)
398
 
398
 
399
See @code{?Startup} for more details of environment files.
399
See @code{?Startup} for more details of environment files.
400
 
400
 
401
@item
401
@item
402
For all applications via Windows.
402
For all applications via Windows.
403
How you set an environment variable is system specific: in Windows 9x
403
How you set an environment variable is system specific: in Windows 9x
404
you can set them in @file{autoexec.bat} or in an MS-DOS window from
404
you can set them in @file{autoexec.bat} or in an MS-DOS window from
405
which you launch @code{Rgui} / @code{Rterm}.  Under Windows NT/2000/XP you
405
which you launch @code{Rgui} / @code{Rterm}.  Under Windows NT/2000/XP you
406
can use the control panel or the properties of `My Computer'.  Under
406
can use the control panel or the properties of `My Computer'.  Under
407
Windows ME you can use the System Configuration Utility (under
407
Windows ME you can use the System Configuration Utility (under
408
Programs, Accessories, System Tools on the Start menu).  You may have to
408
Programs, Accessories, System Tools on the Start menu).  You may have to
409
log out or reboot for such changes to take effect.
409
log out or reboot for such changes to take effect.
410
@end enumerate
410
@end enumerate
411
 
411
 
412
The order of precedence for environmental variables is the order in
412
The order of precedence for environmental variables is the order in
413
which these options are listed, that is the command line then
413
which these options are listed, that is the command line then
414
@file{.Renviron} then the inherited environment.
414
@file{.Renviron} then the inherited environment.
415
 
415
 
416
 
416
 
417
@node R can't find my file, Does R use the Registry?, How do I set environment variables?, Installation and Usage
417
@node R can't find my file, Does R use the Registry?, How do I set environment variables?, Installation and Usage
418
@section R can't find my file, but I know it is there!
418
@section R can't find my file, but I know it is there!
419
 
419
 
420
How did you specify it?  Backslashes have to be doubled in R character
420
How did you specify it?  Backslashes have to be doubled in R character
421
strings, so for example one needs
421
strings, so for example one needs
422
@code{"d:\\@RWVER@\\library\\xgobi\\scripts\\xgobi.bat"}.  You can make
422
@code{"d:\\@RWVER@\\library\\xgobi\\scripts\\xgobi.bat"}.  You can make
423
life easier for yourself by using forward slashes as path separators:
423
life easier for yourself by using forward slashes as path separators:
424
they do work under Windows.
424
they do work under Windows.
425
 
425
 
426
Another possible source of grief is spaces in folder names.  We have
426
Another possible source of grief is spaces in folder names.  We have
427
tried to make R work on paths with spaces in, but lots of people writing
427
tried to make R work on paths with spaces in, but lots of people writing
428
packages for Unix do not bother.  So it is worth trying the alternative
428
packages for Unix do not bother.  So it is worth trying the alternative
429
short name (something like @code{PROGRA~1}; you can get it as the
429
short name (something like @code{PROGRA~1}; you can get it as the
430
`MS-DOS name' from the Properties of the file on most versions of
430
`MS-DOS name' from the Properties of the file on most versions of
431
Windows, and from @code{dir /X} in a @code{Command Prompt} window on 2000/XP).
431
Windows, and from @code{dir /X} in a @code{Command Prompt} window on 2000/XP).
432
 
432
 
433
 
433
 
434
@node Does R use the Registry?, Does R support automation?, R can't find my file, Installation and Usage
434
@node Does R use the Registry?, Does R support automation?, R can't find my file, Installation and Usage
435
@section Does R use the Registry?
435
@section Does R use the Registry?
436
 
436
 
437
Not itself.
437
Not itself.
438
 
438
 
439
The installers set some entries to allow uninstallation.  In addition
439
The installers set some entries to allow uninstallation.  In addition
440
(by default, but this can be de-selected) they set a Registry key
440
(by default, but this can be de-selected) they set a Registry key
441
@code{LOCAL_MACHINE\Software\R-core\R} giving the version and install
441
@code{LOCAL_MACHINE\Software\R-core\R} giving the version and install
442
path.  Again, this is not used by R itself, but it will be used by the
442
path.  Again, this is not used by R itself, but it will be used by the
443
DCOM interface (@uref{http://cran.r-project.org/other-software.html}).
443
DCOM interface (@uref{http://cran.r-project.org/other-software.html}).
444
Finally, a file association for extension @code{.RData} is set in the
444
Finally, a file association for extension @code{.RData} is set in the
445
Registry.
445
Registry.
446
 
446
 
447
You can add the Registry entries by running @code{RSetReg.exe} in the
447
You can add the Registry entries by running @code{RSetReg.exe} in the
448
@code{bin} folder, and remove them by running this with argument
448
@code{bin} folder, and remove them by running this with argument
449
@code{/U}.  Note that the settings are all per machine and not per user,
449
@code{/U}.  Note that the settings are all per machine and not per user,
450
and that this neither sets up nor removes the file associations.
450
and that this neither sets up nor removes the file associations.
451
 
451
 
452
 
452
 
453
@node Does R support automation?, The internet download functions fail., Does R use the Registry?, Installation and Usage
453
@node Does R support automation?, The internet download functions fail., Does R use the Registry?, Installation and Usage
454
@section Does R support automation (OLE, COM)?
454
@section Does R support automation (OLE, COM)?
455
 
455
 
456
Directly, no.
456
Directly, no.
457
 
457
 
458
There is a (D)COM server written by Thomas Baier available on CRAN
458
There is a (D)COM server written by Thomas Baier available on CRAN
459
(@uref{http://cran.r-project.org/other-software.html}) which works with
459
(@uref{http://cran.r-project.org/other-software.html}) which works with
460
@code{Rproxy.dll} (in the R distribution) and @code{R.dll} to support
460
@code{Rproxy.dll} (in the R distribution) and @code{R.dll} to support
461
transfer of data to and from R and remote execution of R commands, as
461
transfer of data to and from R and remote execution of R commands, as
462
well as embedding of an R graphics window.  An R-Excel interface making
462
well as embedding of an R graphics window.  An R-Excel interface making
463
use of the DCOM server is included in the distribution.  @strong{NOTE:}
463
use of the DCOM server is included in the distribution.  @strong{NOTE:}
464
You should ensure that the @code{@RWVER@/bin} directory is in your
464
You should ensure that the @code{@RWVER@/bin} directory is in your
465
path when using this software, so that the R library DLLs are found.
465
path when using this software, so that the R library DLLs are found.
466
 
466
 
467
Another (D)COM server is available from @uref{http://www.omegahat.org/},
467
Another (D)COM server is available from @uref{http://www.omegahat.org/},
468
which allows R objects to be exported as COM values.  That site also
468
which allows R objects to be exported as COM values.  That site also
469
has packages @code{RDCOMClient} and @code{SWinTypeLibs} which allow R
469
has packages @code{RDCOMClient} and @code{SWinTypeLibs} which allow R
470
to act as a (D)COM client.
470
to act as a (D)COM client.
471
 
471
 
472
 
472
 
473
@node The internet download functions fail., Entering certain characters crashes Rgui., Does R support automation?, Installation and Usage
473
@node The internet download functions fail., Entering certain characters crashes Rgui., Does R support automation?, Installation and Usage
474
@section The internet download functions fail.
474
@section The internet download functions fail.
475
 
475
 
476
for example @code{update.packages} and the menu items on the Packages menu.
476
for example @code{update.packages} and the menu items on the Packages menu.
477
 
477
 
478
We have had several reports of this, although they do work for us on
478
We have had several reports of this, although they do work for us on
479
@emph{all} of our machines.  There are two known possible fixes.
479
@emph{all} of our machines.  There are two known possible fixes.
480
 
480
 
481
(a) Use the alternative @code{internet2.dll} by starting R with the flag
481
(a) Use the alternative @code{internet2.dll} by starting R with the flag
482
@option{--internet2} (@pxref{How do I install R for Windows?}) which uses
482
@option{--internet2} (@pxref{How do I install R for Windows?}) which uses
483
the Internet Explorer internals (and so needs Internet Explorer 4 or
483
the Internet Explorer internals (and so needs Internet Explorer 4 or
484
later installed).  Note that this does not work with proxies that need
484
later installed).  Note that this does not work with proxies that need
485
authentication.
485
authentication.
486
 
486
 
487
(b) A proxy needs to be set up: see @code{?download.file}.  Here are two
487
(b) A proxy needs to be set up: see @code{?download.file}.  Here are two
488
versions of an example (a real one, but from a machine that is only
488
versions of an example (a real one, but from a machine that is only
489
available locally) of a command-line in a short cut:
489
available locally) of a command-line in a short cut:
490
 
490
 
491
@smallexample
491
@smallexample
492
/R/@RWVER@/bin/RGui.exe http_proxy=http://user:pass@@gannet:80/
492
/R/@RWVER@/bin/RGui.exe http_proxy=http://user:pass@@gannet:80/
493
 
493
 
494
/R/@RWVER@/bin/RGui.exe http_proxy=http://gannet/ http_proxy_user=ask
494
/R/@RWVER@/bin/RGui.exe http_proxy=http://gannet/ http_proxy_user=ask
495
@end smallexample
495
@end smallexample
496
 
496
 
497
@noindent
497
@noindent
498
The second version will prompt the user for the proxy username and
498
The second version will prompt the user for the proxy username and
499
password when HTTP downloads are first used.
499
password when HTTP downloads are first used.
500
 
500
 
501
 
501
 
502
@node Entering certain characters crashes Rgui., Other strange crashes., The internet download functions fail., Installation and Usage
502
@node Entering certain characters crashes Rgui., Other strange crashes., The internet download functions fail., Installation and Usage
503
@section Entering certain characters crashes Rgui.
503
@section Entering certain characters crashes Rgui.
504
 
504
 
505
This used to happen occasionally, and all the occurrences we have solved
505
This used to happen occasionally, and all the occurrences we have solved
506
have been traced to faulty versions of @samp{msvcrt.dll}.  We have
506
have been traced to faulty versions of @samp{msvcrt.dll}.  We have
507
installed a workaround that seems to avoid this.  A few other people
507
installed a workaround that seems to avoid this.  A few other people
508
have discovered this was caused by desktop switcher and keyboard macro
508
have discovered this was caused by desktop switcher and keyboard macro
509
programs, for example `Macro Magic' and `JS Pager'.
509
programs, for example `Macro Magic' and `JS Pager'.
510
 
510
 
511
If it still happens, try extracting the one to be found in the
511
If it still happens, try extracting the one to be found in the
512
self-extracting archive
512
self-extracting archive
513
@uref{ftp://ftp.microsoft.com/softlib/mslfiles/msvcrt.exe} and put it in
513
@uref{ftp://ftp.microsoft.com/softlib/mslfiles/msvcrt.exe} and put it in
514
the @code{@RWVER@\bin} directory.  Removing @samp{msvcrt.dll} from that
514
the @code{@RWVER@\bin} directory.  Removing @samp{msvcrt.dll} from that
515
directory reverts to the standard behaviour.
515
directory reverts to the standard behaviour.
516
It seems that on some versions of Windows (but not 2000/XP) you also
516
It seems that on some versions of Windows (but not 2000/XP) you also
517
need to put the @code{@RWVER@\bin} directory early in your path.
517
need to put the @code{@RWVER@\bin} directory early in your path.
518
 
518
 
519
This fix has solved other problems too, for example incorrect results in
519
This fix has solved other problems too, for example incorrect results in
520
the date-time functions.  However, you are probably better off
520
the date-time functions.  However, you are probably better off
521
re-installing Windows.
521
re-installing Windows.
522
 
522
 
523
 
523
 
524
 
524
 
525
@node Other strange crashes.,  , Entering certain characters crashes Rgui., Installation and Usage
525
@node Other strange crashes.,  , Entering certain characters crashes Rgui., Installation and Usage
526
@section Other strange crashes.
526
@section Other strange crashes.
527
 
527
 
528
Some users have found that @code{Rgui.exe} fails to start, exiting with
528
Some users have found that @code{Rgui.exe} fails to start, exiting with
529
a ``Floating- point invalid operation'' or other low level error.  This
529
a ``Floating- point invalid operation'' or other low level error.  This
530
error may also happen in the middle of a session.  In some cases where
530
error may also happen in the middle of a session.  In some cases where
531
we have tracked this down, it was due to bugs in the video driver on the
531
we have tracked this down, it was due to bugs in the video driver on the
532
system in question: it makes changes to the floating point control word
532
system in question: it makes changes to the floating point control word
533
which are incompatible with R.  (Good practice would restore the control
533
which are incompatible with R.  (Good practice would restore the control
534
word to the state it was in when the driver code was called.) For
534
word to the state it was in when the driver code was called.) For
535
example, one user reported that the virtual screen manager JSP2 caused
535
example, one user reported that the virtual screen manager JSP2 caused
536
this crash.
536
this crash.
537
 
537
 
538
These errors are essentially impossible for us to fix or work around.
538
These errors are essentially impossible for us to fix or work around.
539
The only solution we know of is for the user to replace the buggy driver
539
The only solution we know of is for the user to replace the buggy driver
540
that is causing the error.
540
that is causing the error.
541
 
541
 
542
 
542
 
543
 
543
 
544
@newchap{}
544
@newchap{}
545
@node Packages, Windows Features, Installation and Usage, Top
545
@node Packages, Windows Features, Installation and Usage, Top
546
@chapter Packages
546
@chapter Packages
547
 
547
 
548
 
548
 
549
@menu
549
@menu
550
* Can I install packages (libraries) in this version?::
550
* Can I install packages (libraries) in this version?::
551
* I don't have permission to write to the @RWVER@\library directory::
551
* I don't have permission to write to the @RWVER@\library directory::
552
* The packages I installed do not appear in the HTML help system::
552
* The packages I installed do not appear in the HTML help system::
553
* My functions are not found by the HTML help search system.::
553
* My functions are not found by the HTML help search system.::
554
* Loading a package fails.::
554
* Loading a package fails.::
555
* Package TclTk does not work.::
555
* Package TclTk does not work.::
556
* Hyperlinks in Compiled HTML do not work.::
556
* Hyperlinks in Compiled HTML do not work.::
557
* update.packages() fails::
557
* update.packages() fails::
558
@end menu
558
@end menu
559
 
559
 
560
 
560
 
561
@node Can I install packages (libraries) in this version?, I don't have permission to write to the @RWVER@\library directory, Packages, Packages
561
@node Can I install packages (libraries) in this version?, I don't have permission to write to the @RWVER@\library directory, Packages, Packages
562
@section Can I install packages (libraries) in this version?
562
@section Can I install packages (libraries) in this version?
563
 
563
 
564
Yes, but you will need a lot of tools to do so, unless the author or the
564
Yes, but you will need a lot of tools to do so, unless the author or the
565
maintainers of the @code{bin/windows/contrib} section on CRAN have been
565
maintainers of the @code{bin/windows/contrib} section on CRAN have been
566
kind enough to provide a pre-compiled version for Windows as a
566
kind enough to provide a pre-compiled version for Windows as a
567
@code{.zip} file.
567
@code{.zip} file.
568
 
568
 
569
You can install pre-compiled packages either from CRAN or from a local
569
You can install pre-compiled packages either from CRAN or from a local
570
@code{.zip} file by using @code{install.packages}: see its help page.
570
@code{.zip} file by using @code{install.packages}: see its help page.
571
There are menu items on the @code{Packages} menu to provide a
571
There are menu items on the @code{Packages} menu to provide a
572
point-and-click interface to package installation.  The packages for
572
point-and-click interface to package installation.  The packages for
573
each minor (1.x) version will be stored in a separate area, so for R
573
each minor (1.x) version will be stored in a separate area, so for R
574
1.9.? the files are in @code{bin/windows/contrib/1.9}.  You can try
574
1.9.? the files are in @code{bin/windows/contrib/1.9}.  You can try
575
those compiled for earlier versions, at your own risk.
575
those compiled for earlier versions, at your own risk.
576
 
576
 
577
Note that the pre-compiled versions on CRAN are unsupported: see
577
Note that the pre-compiled versions on CRAN are unsupported: see
578
@uref{http://cran.r-project.org/bin/windows/contrib/ReadMe}, which also
578
@uref{http://cran.r-project.org/bin/windows/contrib/ReadMe}, which also
579
gives the locations of a few other precompiled packages.
579
gives the locations of a few other precompiled packages.
580
 
580
 
581
If there is not a pre-compiled version or that is not up-to-date or
581
If there is not a pre-compiled version or that is not up-to-date or
582
you prefer compiling from source, make sure you installed the
582
you prefer compiling from source, make sure you installed the
583
necessary files from @code{@RWVER@.exe}.  Then read the file
583
necessary files from @code{@RWVER@.exe}.  Then read the file
584
@file{readme.packages}.  You will need to collect and install several
584
@file{readme.packages}.  You will need to collect and install several
585
tools to use this: you can download them via the portal at
585
tools to use this: you can download them via the portal at
586
@uref{http://www.stats.ox.ac.uk/pub/Rtools/}.  Once you have done so,
586
@uref{http://www.stats.ox.ac.uk/pub/Rtools/}.  Once you have done so,
587
just run @code{Rcmd INSTALL pkgname}.  To check the package (including
587
just run @code{Rcmd INSTALL pkgname}.  To check the package (including
588
running all the examples on its help pages and in its test suite, if
588
running all the examples on its help pages and in its test suite, if
589
any) use @code{Rcmd check pkgname}: see the @emph{`Writing R
589
any) use @code{Rcmd check pkgname}: see the @emph{`Writing R
590
Extensions'} manual.
590
Extensions'} manual.
591
 
591
 
592
Note that this is rather tricky; please do ensure that you have followed
592
Note that this is rather tricky; please do ensure that you have followed
593
the instructions @strong{exactly}.  At least 90% of the questions asked
593
the instructions @strong{exactly}.  At least 90% of the questions asked
594
are because people have not done so.
594
are because people have not done so.
595
 
595
 
596
 
596
 
597
@node I don't have permission to write to the @RWVER@\library directory, The packages I installed do not appear in the HTML help system, Can I install packages (libraries) in this version?, Packages
597
@node I don't have permission to write to the @RWVER@\library directory, The packages I installed do not appear in the HTML help system, Can I install packages (libraries) in this version?, Packages
598
@section I don't have permission to write to the @file{@RWVER@\library} directory.
598
@section I don't have permission to write to the @file{@RWVER@\library} directory.
599
 
599
 
600
You can install packages anywhere and use the environment variable
600
You can install packages anywhere and use the environment variable
601
@env{R_LIBS} (@pxref{How do I set environment variables?}) to point to
601
@env{R_LIBS} (@pxref{How do I set environment variables?}) to point to
602
the library location(s).
602
the library location(s).
603
 
603
 
604
Suppose your packages are installed in @code{p:\myRlib}.  Then you can
604
Suppose your packages are installed in @code{p:\myRlib}.  Then you can
605
EITHER
605
EITHER
606
 
606
 
607
@example
607
@example
608
set the environment variable R_LIBS to p:\myRlib
608
set the environment variable R_LIBS to p:\myRlib
609
@end example
609
@end example
610
@noindent
610
@noindent
611
OR use a package by, e.g.
611
OR use a package by, e.g.
612
 
612
 
613
@example
613
@example
614
library(mypkg, lib.loc="p:/myRlib")
614
library(mypkg, lib.loc="p:/myRlib")
615
@end example
615
@end example
616
 
616
 
617
 
617
 
618
 
618
 
619
@node The packages I installed do not appear in the HTML help system, My functions are not found by the HTML help search system., I don't have permission to write to the @RWVER@\library directory, Packages
619
@node The packages I installed do not appear in the HTML help system, My functions are not found by the HTML help search system., I don't have permission to write to the @RWVER@\library directory, Packages
620
@section The packages I installed do not appear in the HTML help system.
620
@section The packages I installed do not appear in the HTML help system.
621
 
621
 
622
To update the HTML indices after you have installed a pre-compiled
622
To update the HTML indices after you have installed a pre-compiled
623
package, run at the R prompt.
623
package, run at the R prompt.
624
 
624
 
625
@example
625
@example
626
> link.html.help()
626
> link.html.help()
627
@end example
627
@end example
628
 
628
 
629
This is done automatically when installing from the Packages menu or
629
This is done automatically when installing from the Packages menu or
630
by @code{install.packages()}, and when @code{help.start} is run,
630
by @code{install.packages()}, and when @code{help.start} is run,
631
provided you have write permission in @file{@RWVER@}.
631
provided you have write permission in @file{@RWVER@}.
632
 
632
 
633
 
633
 
634
@node My functions are not found by the HTML help search system., Loading a package fails., The packages I installed do not appear in the HTML help system, Packages
634
@node My functions are not found by the HTML help search system., Loading a package fails., The packages I installed do not appear in the HTML help system, Packages
635
@section My functions are not found by the HTML help search system.
635
@section My functions are not found by the HTML help search system.
636
 
636
 
637
The following conditions need to hold for functions in a package you installed.
637
The following conditions need to hold for functions in a package you installed.
638
 
638
 
639
@itemize @bullet
639
@itemize @bullet
640
@item the package is installed in @file{@RWVER@\library}.
640
@item the package is installed in @file{@RWVER@\library}.
641
@item the package contains a @file{CONTENTS} file in its top-level directory.
641
@item the package contains a @file{CONTENTS} file in its top-level directory.
642
@item you updated the indices as described in the answer to Q3.3 after
642
@item you updated the indices as described in the answer to Q3.3 after
643
installing the package.
643
installing the package.
644
@end itemize
644
@end itemize
645
@noindent
645
@noindent
646
If those all hold true, this works for us.
646
If those all hold true, this works for us.
647
 
647
 
648
If the help search system does not work @emph{at all}, this probably
648
If the help search system does not work @emph{at all}, this probably
649
indicates that Java support is either not installed or not enabled in
649
indicates that Java support is either not installed or not enabled in
650
your browser.  Recent versions of browsers have made Java support
650
your browser.  Recent versions of browsers have made Java support
651
optional: for example it is optional in Netscape 6/7 and in Opera, and
651
optional: for example it is optional in Netscape 6/7 and in Opera, and
652
may not be installed for IE6 on Windows XP.  You also need JavaScript
652
may not be installed for IE6 on Windows XP.  You also need JavaScript
653
enabled,
653
enabled.
654
 
654
 
655
@node Loading a package fails., Package TclTk does not work., My functions are not found by the HTML help search system., Packages
655
@node Loading a package fails., Package TclTk does not work., My functions are not found by the HTML help search system., Packages
656
@section Loading a package fails.
656
@section Loading a package fails.
657
 
657
 
658
Is the package compiled for this version of R?  Many of the packages
658
Is the package compiled for this version of R?  Many of the packages
659
need to be compiled for a fairly recent version.
659
need to be compiled for a fairly recent version.
660
 
660
 
661
You can tell the version the package was compiled for by looking at the
661
You can tell the version the package was compiled for by looking at the
662
@code{Built:} line in its @file{DESCRIPTION} file or at the
662
@code{Built:} line in its @file{DESCRIPTION} file or at the
663
@code{Version} tab of its DLL (if it has one) in the @file{libs}
663
@code{Version} tab of its DLL (if it has one) in the @file{libs}
664
directory.  (Right-click on the DLL in Windows Explorer and select
664
directory.  (Right-click on the DLL in Windows Explorer and select
665
@code{Version} tab of the @code{Properties}, or use the
665
@code{Version} tab of the @code{Properties}, or use the
666
@code{DLL.version} function inside R.)  If there is no @code{Built:}
666
@code{DLL.version} function inside R.)
667
line or version tab, the package was compiled far too long ago.
-
 
668
 
667
 
669
 
668
 
670
@node Package TclTk does not work., Hyperlinks in Compiled HTML do not work., Loading a package fails., Packages
669
@node Package TclTk does not work., Hyperlinks in Compiled HTML do not work., Loading a package fails., Packages
671
@section Package TclTk does not work.
670
@section Package TclTk does not work.
672
 
671
 
673
For package @code{tcltk} to work (try @code{demo(tkdensity)} or
672
For package @code{tcltk} to work (try @code{demo(tkdensity)} or
674
@code{demo(tkttest)} after @code{library(tcltk)}) you need to have Tcl
673
@code{demo(tkttest)} after @code{library(tcltk)}) you need to have Tcl
675
installed.  This is an optional part of the installation by
674
installed.  This is an optional part of the installation by
676
@code{@value{VERSION}.exe}, although it is selected by default.
675
@code{@value{VERSION}.exe}, although it is selected by default.
677
If the message is
676
If the message is
678
@smallexample
677
@smallexample
679
Tcl/Tk support files were not installed
678
Tcl/Tk support files were not installed
680
@end smallexample
679
@end smallexample
681
the optional files were not installed, and you need to go back to the
680
the optional files were not installed, and you need to go back to the
682
installer and install them.  (Note: package @code{tcltk} is not part of
681
installer and install them.  (Note: package @code{tcltk} is not part of
683
the @code{miniR} installer.)
682
the @code{miniR} installer.)
684
 
683
 
685
Alternatively, if you have the environment variable @code{MY_TCLTK} set
684
Alternatively, if you have the environment variable @code{MY_TCLTK} set
686
to a non-empty value, it is assumed that you want to use a different
685
to a non-empty value, it is assumed that you want to use a different
687
Tcl/Tk 8.4.x installation, and that this is set up correctly (with the
686
Tcl/Tk 8.4.x installation, and that this is set up correctly (with the
688
DLLs in your path and @code{TCL_LIBRARY} set).  In that case you do not
687
DLLs in your path and @code{TCL_LIBRARY} set).  In that case you do not
689
need the Tcl/Tk support files installed (but they can be).  Note that
688
need the Tcl/Tk support files installed (but they can be).  Note that
690
you do need 8.4.x and not 8.3.x.  (If you build R from the sources
689
you do need 8.4.x and not 8.3.x.  (If you build R from the sources
691
yourself you can configure it to use 8.3.x.)
690
yourself you can configure it to use 8.3.x.)
692
 
691
 
693
 
692
 
694
@node  Hyperlinks in Compiled HTML do not work., update.packages() fails, Package TclTk does not work., Packages
693
@node  Hyperlinks in Compiled HTML do not work., update.packages() fails, Package TclTk does not work., Packages
695
@section Hyperlinks in Compiled HTML sometimes do not work.
694
@section Hyperlinks in Compiled HTML sometimes do not work.
696
 
695
 
697
They may well not work between packages installed in different
696
They may well not work between packages installed in different
698
libraries.  This is solved under Unix using symbolic links which Windows
697
libraries.  This is solved under Unix using symbolic links which Windows
699
does not implement.
698
does not implement.
700
 
699
 
701
@node update.packages() fails,  , Hyperlinks in Compiled HTML do not work., Packages
700
@node update.packages() fails,  , Hyperlinks in Compiled HTML do not work., Packages
702
@section @code{update.packages()} fails
701
@section @code{update.packages()} fails
703
 
702
 
704
You may not be able to update a package which is in use: Windows `locks'
703
You may not be able to update a package which is in use: Windows `locks'
705
the package's DLL when it is loaded.  So use @code{update.packages()}
704
the package's DLL when it is loaded.  So use @code{update.packages()}
706
(or the menu equivalent) in a new session.
705
(or the menu equivalent) in a new session.
707
 
706
 
708
If you put @code{library(foo)} in your @file{.Rprofile} you will need to
707
If you put @code{library(foo)} in your @file{.Rprofile} you will need to
709
start R with @option{--vanilla} to be able to update package @code{foo}.
708
start R with @option{--vanilla} to be able to update package @code{foo}.
-
 
709
If you set @code{R_DEFAULT_PACKAGES} to include @code{foo}, you will
-
 
710
need to unset it temporarily.
710
 
711
 
711
@newchap{}
712
@newchap{}
712
@node Windows Features, Workspaces, Packages, Top
713
@node Windows Features, Workspaces, Packages, Top
713
@chapter Windows Features
714
@chapter Windows Features
714
 
715
 
715
@menu
716
@menu
716
* What should I expect to behave differently from the Unix version::
717
* What should I expect to behave differently from the Unix version::
717
* I hear about some nifty features.::
718
* I hear about some nifty features.::
718
* Circles appear as ovals on screen::
719
* Circles appear as ovals on screen::
719
* How do I move focus to a graphics window or the console?::
720
* How do I move focus to a graphics window or the console?::
720
@end menu
721
@end menu
721
 
722
 
722
 
723
 
723
@node  What should I expect to behave differently from the Unix version, I hear about some nifty features., Windows Features, Windows Features
724
@node  What should I expect to behave differently from the Unix version, I hear about some nifty features., Windows Features, Windows Features
724
@section  What should I expect to behave differently from the Unix version of R?
725
@section  What should I expect to behave differently from the Unix version of R?
725
 
726
 
726
@itemize @bullet
727
@itemize @bullet
727
@item R commands can be interrupted by @key{Esc} in @code{Rgui.exe}
728
@item R commands can be interrupted by @key{Esc} in @code{Rgui.exe}
728
and @key{Ctrl-break} or @key{Ctrl-C} in @code{Rterm.exe}: @key{Ctrl-C}
729
and @key{Ctrl-break} or @key{Ctrl-C} in @code{Rterm.exe}: @key{Ctrl-C}
729
is used for copying in the GUI version.
730
is used for copying in the GUI version.
730
 
731
 
731
@item Command-line editing is always available, but is simpler than the
732
@item Command-line editing is always available, but is simpler than the
732
readline-based editing on Unix.  For @code{Rgui.exe}, the menu item `Help |
733
readline-based editing on Unix.  For @code{Rgui.exe}, the menu item `Help |
733
Console' will give details.  For @code{Rterm.exe} see file
734
Console' will give details.  For @code{Rterm.exe} see file
734
@file{README.rterm}.
735
@file{README.rterm}.
735
 
736
 
736
@item Using @code{help.start()} does not automatically send help
737
@item Using @code{help.start()} does not automatically send help
737
requests to the browser: use @code{options(htmlhelp=TRUE)} to turn this on.
738
requests to the browser: use @code{options(htmlhelp=TRUE)} to turn this on.
738
 
739
 
739
@item The HTML help system has limitations in supporting cross-library links.
740
@item The HTML help system has limitations in supporting cross-library links.
740
 
741
 
741
@item Paths to files (e.g. in @code{source()}) can be specified with
742
@item Paths to files (e.g. in @code{source()}) can be specified with
742
either "/" or "\\".
743
either "/" or "\\".
743
 
744
 
744
@item @code{system()} is slightly different: see its help page and that
745
@item @code{system()} is slightly different: see its help page and that
745
of @code{shell()}.
746
of @code{shell()}.
746
@end itemize
747
@end itemize
747
 
748
 
748
 
749
 
749
@node I hear about some nifty features., Circles appear as ovals on screen, What should I expect to behave differently from the Unix version, Windows Features
750
@node I hear about some nifty features., Circles appear as ovals on screen, What should I expect to behave differently from the Unix version, Windows Features
750
@section I hear about some nifty features: please tell me about them!
751
@section I hear about some nifty features: please tell me about them!
751
 
752
 
752
You have read the @code{README.@RWVER@}? There are file menus on the R console,
753
You have read the @code{README.@RWVER@}? There are file menus on the R console,
753
pager and graphics windows.  You can source and save from those menus,
754
pager and graphics windows.  You can source and save from those menus,
754
and copy the graphics to @code{png}, @code{jpeg}, @code{bmp},
755
and copy the graphics to @code{png}, @code{jpeg}, @code{bmp},
755
@code{postscript}, @code{PDF} or @code{metafile}.  There are right-click
756
@code{postscript}, @code{PDF} or @code{metafile}.  There are right-click
756
menus giving shortcuts to menu items, and optionally toolbars with
757
menus giving shortcuts to menu items, and optionally toolbars with
757
buttons giving shortcuts to frequent operations.
758
buttons giving shortcuts to frequent operations.
758
 
759
 
759
If you resize the R console the @code{options(width=)} is automatically
760
If you resize the R console the @code{options(width=)} is automatically
760
set to the console width (unless disabled in the configuration file).
761
set to the console width (unless disabled in the configuration file).
761
 
762
 
762
The graphics has a history mechanism.  As @code{README.@RWVER@} says:
763
The graphics has a history mechanism.  As @code{README.@RWVER@} says:
763
 
764
 
764
@quotation
765
@quotation
765
`The History menu allows the recording of plots.  When plots have been
766
`The History menu allows the recording of plots.  When plots have been
766
recorded they can be reviewed by @key{PgUp} and @key{PgDn}, saved and
767
recorded they can be reviewed by @key{PgUp} and @key{PgDn}, saved and
767
replaced.  Recording can be turned on automatically (the Recording item
768
replaced.  Recording can be turned on automatically (the Recording item
768
on the list) or individual plots can be added (Add or the @key{INS}
769
on the list) or individual plots can be added (Add or the @key{INS}
769
key).  The whole plot history can be saved to or retrieved from an R
770
key).  The whole plot history can be saved to or retrieved from an R
770
variable in the global environment.
771
variable in the global environment.
771
 
772
 
772
There is only one graphics history shared by all the windows devices.'
773
There is only one graphics history shared by all the windows devices.'
773
@end quotation
774
@end quotation
774
@noindent
775
@noindent
775
The R console and graphics windows have configuration files stored in
776
The R console and graphics windows have configuration files stored in
776
the @file{RHOME\etc} directory called @file{Rconsole} and @file{Rdevga};
777
the @file{RHOME\etc} directory called @file{Rconsole} and @file{Rdevga};
777
you can keep personal copies in your @file{HOME} directory.  They contain
778
you can keep personal copies in your @file{HOME} directory.  They contain
778
comments which should suffice for you to edit them to your
779
comments which should suffice for you to edit them to your
779
preferences.  For more details see @code{?Rconsole}.
780
preferences.  For more details see @code{?Rconsole}.
780
There is a Preferences editor invoked from the @code{Edit} menu which
781
There is a Preferences editor invoked from the @code{Edit} menu which
781
can be used to edit the file @file{Rconsole}.
782
can be used to edit the file @file{Rconsole}.
782
 
783
 
783
 
784
 
784
@node Circles appear as ovals on screen, How do I move focus to a graphics window or the console?, I hear about some nifty features., Windows Features
785
@node Circles appear as ovals on screen, How do I move focus to a graphics window or the console?, I hear about some nifty features., Windows Features
785
@section Circles appear as ovals on screen
786
@section Circles appear as ovals on screen
786
 
787
 
787
The graphics system asks Windows for the number of pixels per inch in
788
The graphics system asks Windows for the number of pixels per inch in
788
the X and Y directions, and uses that to size graphics (which in R are
789
the X and Y directions, and uses that to size graphics (which in R are
789
in units of inches).  Sometimes the answer is a complete invention, and
790
in units of inches).  Sometimes the answer is a complete invention, and
790
in any case Windows will not know exactly how the horizontal and
791
in any case Windows will not know exactly how the horizontal and
791
vertical size have been set on a CRT.  You can specify correct values
792
vertical size have been set on a CRT.  You can specify correct values
792
either in the call to @code{windows} or as options: see @code{?windows}.
793
either in the call to @code{windows} or as options: see @code{?windows}.
793
(Typically these are of the order of 80.)
794
(Typically these are of the order of 80.)
794
 
795
 
795
On one of our systems, the screen height is reported as 240mm, and the
796
On one of our systems, the screen height is reported as 240mm, and the
796
width as 300mm in 1280 x 1024 mode and 320mm in 1280 x 960 and 1600 x 1200
797
width as 300mm in 1280 x 1024 mode and 320mm in 1280 x 960 and 1600 x 1200
797
modes.  In fact it is a 21" monitor and 400mm x 300mm!
798
modes.  In fact it is a 21" monitor and 400mm x 300mm!
798
 
799
 
799
@node How do I move focus to a graphics window or the console?,  , Circles appear as ovals on screen, Windows Features
800
@node How do I move focus to a graphics window or the console?,  , Circles appear as ovals on screen, Windows Features
800
@section How do I move focus to a graphics window or the console?
801
@section How do I move focus to a graphics window or the console?
801
 
802
 
802
You may want to do this from within a function, for example when calling
803
You may want to do this from within a function, for example when calling
803
@samp{identify} or @samp{readline}.  Use the function
804
@samp{identify} or @samp{readline}.  Use the function
804
@samp{bringToTop()}.  With its default argument it brings the active
805
@samp{bringToTop()}.  With its default argument it brings the active
805
graphics window to the top and gives it focus.  With argument @samp{-1}
806
graphics window to the top and gives it focus.  With argument @samp{-1}
806
it brings the console to the top and gives it focus.
807
it brings the console to the top and gives it focus.
807
 
808
 
808
This works for @samp{Rgui.exe} in MDI and SDI modes, and can be used for
809
This works for @samp{Rgui.exe} in MDI and SDI modes, and can be used for
809
graphics windows from @samp{Rterm.exe} (although Windows may not always
810
graphics windows from @samp{Rterm.exe} (although Windows may not always
810
act on it).
811
act on it).
811
 
812
 
812
@newchap{}
813
@newchap{}
813
@node Workspaces, The R Console and Fonts, Windows Features, Top
814
@node Workspaces, The R Console and Fonts, Windows Features, Top
814
@chapter Workspaces
815
@chapter Workspaces
815
 
816
 
816
 
817
 
817
@menu
818
@menu
818
* My workspace gets saved in a strange place.  How do I stop this?::
819
* My workspace gets saved in a strange place.  How do I stop this?::
819
* How do I store my workspace in a different place?::
820
* How do I store my workspace in a different place?::
820
* Can I load workspaces saved under Unix/GNU-Linux or MacOS?::
821
* Can I load workspaces saved under Unix/GNU-Linux or MacOS?::
821
@end menu
822
@end menu
822
 
823
 
823
 
824
 
824
@node My workspace gets saved in a strange place.  How do I stop this?, How do I store my workspace in a different place?, Workspaces, Workspaces
825
@node My workspace gets saved in a strange place.  How do I stop this?, How do I store my workspace in a different place?, Workspaces, Workspaces
825
@section My workspace gets saved in a strange place: how do I stop this?
826
@section My workspace gets saved in a strange place: how do I stop this?
826
 
827
 
827
Have you changed the working directory?: see Q5.2.
828
Have you changed the working directory?: see Q5.2.
828
 
829
 
829
 
830
 
830
@node How do I store my workspace in a different place?, Can I load workspaces saved under Unix/GNU-Linux or MacOS?, My workspace gets saved in a strange place.  How do I stop this?, Workspaces
831
@node How do I store my workspace in a different place?, Can I load workspaces saved under Unix/GNU-Linux or MacOS?, My workspace gets saved in a strange place.  How do I stop this?, Workspaces
831
@section How do I store my workspace in a different place?
832
@section How do I store my workspace in a different place?
832
 
833
 
833
Use the `File | Change Dir...' menu item to select a new working
834
Use the `File | Change Dir...' menu item to select a new working
834
directory: this defaults to the last directory you loaded a file
835
directory: this defaults to the last directory you loaded a file
835
from.  The workspace is saved in the working directory.  You can also
836
from.  The workspace is saved in the working directory.  You can also
836
save a snapshot of the workspace from the `Save Workspace...' menu item.
837
save a snapshot of the workspace from the `Save Workspace...' menu item.
837
 
838
 
838
From the command line you can change the working directory by the
839
From the command line you can change the working directory by the
839
function @code{setwd}: see its help page.
840
function @code{setwd}: see its help page.
840
 
841
 
841
 
842
 
842
@node Can I load workspaces saved under Unix/GNU-Linux or MacOS?,  , How do I store my workspace in a different place?, Workspaces
843
@node Can I load workspaces saved under Unix/GNU-Linux or MacOS?,  , How do I store my workspace in a different place?, Workspaces
843
@section Can I load workspaces saved under Unix/GNU-Linux or MacOS?
844
@section Can I load workspaces saved under Unix/GNU-Linux or MacOS?
844
 
845
 
845
Yes.  All ports of R use the same format for workspaces, so they are
846
Yes.  All ports of R use the same format for workspaces, so they are
846
interchangeable (for the same 1.x.? version of R, at least).
847
interchangeable (for the same 1.x.? version of R, at least).
847
 
848
 
848
 
849
 
849
@newchap{}
850
@newchap{}
850
@node The R Console and Fonts, Building from Source, Workspaces, Top
851
@node The R Console and Fonts, Building from Source, Workspaces, Top
851
@chapter The R Console and Fonts
852
@chapter The R Console and Fonts
852
 
853
 
853
 
854
 
854
@menu
855
@menu
855
* I would like to be able to use Japanese fonts::
856
* I would like to be able to use Japanese fonts::
856
* I don't see characters with accents at the R console::
857
* I don't see characters with accents at the R console::
857
* The output to the console seems to be delayed::
858
* The output to the console seems to be delayed::
858
* Long lines seem to be truncated.::
859
* Long lines seem to be truncated.::
859
@end menu
860
@end menu
860
 
861
 
861
 
862
 
862
@node I would like to be able to use Japanese fonts, I don't see characters with accents at the R console, The R Console and Fonts, The R Console and Fonts
863
@node I would like to be able to use Japanese fonts, I don't see characters with accents at the R console, The R Console and Fonts, The R Console and Fonts
863
@section I would like to be able to use Japanese fonts
864
@section I would like to be able to use Japanese fonts
864
 
865
 
865
for example, in the console and to annotate graphs.  Similar comments
866
for example, in the console and to annotate graphs.  Similar comments
866
apply to any non-Western European language.
867
apply to any non-Western European language.
867
 
868
 
868
We believe this is possible by setting suitable fonts in the Rconsole and
869
We believe this is possible by setting suitable fonts in the Rconsole and
869
Rdevga configuration files (see Q4.2).  You can specify additional fonts in
870
Rdevga configuration files (see Q4.2).  You can specify additional fonts in
870
Rdevga, and use them by
871
Rdevga, and use them by
871
 
872
 
872
@example
873
@example
873
par(font=, font.lab=, font.main=, font.sub=)
874
par(font=, font.lab=, font.main=, font.sub=)
874
@end example
875
@end example
875
 
876
 
876
Nineteen fonts are specified (as 1 to 19) by default: you can add to these
877
Nineteen fonts are specified (as 1 to 19) by default: you can add to these
877
(up to 13 more) or replace them.
878
(up to 13 more) or replace them.
878
 
879
 
879
In addition, the Hershey vector fonts (see @code{?Hershey},
880
In addition, the Hershey vector fonts (see @code{?Hershey},
880
@code{?Japanese} and @code{demo(Japanese)}) can be used on any graphics
881
@code{?Japanese} and @code{demo(Japanese)}) can be used on any graphics
881
device to display Japanese characters.
882
device to display Japanese characters.
882
 
883
 
883
 
884
 
884
@node I don't see characters with accents at the R console, The output to the console seems to be delayed, I would like to be able to use Japanese fonts, The R Console and Fonts
885
@node I don't see characters with accents at the R console, The output to the console seems to be delayed, I would like to be able to use Japanese fonts, The R Console and Fonts
885
@section I don't see characters with accents at the R console, for example in ?text.
886
@section I don't see characters with accents at the R console, for example in ?text.
886
 
887
 
887
You need to specify a font in Rconsole (see Q4.2) that supports Latin1
888
You need to specify a font in Rconsole (see Q4.2) that supports Latin1
888
encoding.  The default, @code{Courier New}, does on our systems, as does
889
encoding.  The default, @code{Courier New}, does on our systems, as does
889
@code{FixedSys}.  This may be a problem in other locales, especially for
890
@code{FixedSys}.  This may be a problem in other locales, especially for
890
non-Western European languages.
891
non-Western European languages.
891
 
892
 
892
Support for these characters within @code{Rterm} depends on the
893
Support for these characters within @code{Rterm} depends on the
893
environment (the terminal window and shell, including locale settings)
894
environment (the terminal window and shell, including locale settings)
894
within which it is run as well as the font used by the terminal window.
895
within which it is run as well as the font used by the terminal window.
895
 
896
 
896
If you are using a non-Latin1 language, you do need to ensure that the
897
If you are using a non-Latin1 language, you do need to ensure that the
897
fonts you selected support the language.  For example, it was found by
898
fonts you selected support the language.  For example, it was found by
898
one Czech user (under Windows 98) that he had to select @code{Times New
899
one Czech user (under Windows 98) that he had to select @code{Times New
899
Roman CE} or @code{Courier} (not @code{Courier New}) to get certain
900
Roman CE} or @code{Courier} (not @code{Courier New}) to get certain
900
Czech characters displayed correctly.
901
Czech characters displayed correctly.
901
 
902
 
902
@node The output to the console seems to be delayed, Long lines seem to be truncated., I don't see characters with accents at the R console, The R Console and Fonts
903
@node The output to the console seems to be delayed, Long lines seem to be truncated., I don't see characters with accents at the R console, The R Console and Fonts
903
@section When using Rgui the output to the console seems to be delayed.
904
@section When using Rgui the output to the console seems to be delayed.
904
 
905
 
905
This is deliberate: the console output is buffered and re-written in
906
This is deliberate: the console output is buffered and re-written in
906
chunks to be faster and less distracting.  You can turn buffering off or
907
chunks to be faster and less distracting.  You can turn buffering off or
907
on from the `Misc' menu or the right-click menu: @key{Ctrl-W} toggles
908
on from the `Misc' menu or the right-click menu: @key{Ctrl-W} toggles
908
the setting.
909
the setting.
909
 
910
 
910
If you are sourcing R code or writing from a function, there is another
911
If you are sourcing R code or writing from a function, there is another
911
option.  A call to the R function @code{flush.console()} will write out
912
option.  A call to the R function @code{flush.console()} will write out
912
the buffer and so update the console.
913
the buffer and so update the console.
913
 
914
 
914
 
915
 
915
@node Long lines seem to be truncated.,  , The output to the console seems to be delayed, The R Console and Fonts
916
@node Long lines seem to be truncated.,  , The output to the console seems to be delayed, The R Console and Fonts
916
@section Long lines in the console or pager are truncated.
917
@section Long lines in the console or pager are truncated.
917
 
918
 
918
They only @strong{seem} to be truncated: that $ at the end indicates you
919
They only @strong{seem} to be truncated: that $ at the end indicates you
919
can scroll the window to see the rest of the line.  Use the horizontal
920
can scroll the window to see the rest of the line.  Use the horizontal
920
scrollbar or the @key{CTRL + left/right arrow} keys to scroll
921
scrollbar or the @key{CTRL + left/right arrow} keys to scroll
921
horizontally. (The @key{left/right arrow} keys work in the pager too.)
922
horizontally. (The @key{left/right arrow} keys work in the pager too.)
922
 
923
 
923
 
924
 
924
 
925
 
925
@newchap{}
926
@newchap{}
926
@node Building from Source,  , The R Console and Fonts, Top
927
@node Building from Source,  , The R Console and Fonts, Top
927
@chapter Building from Source
928
@chapter Building from Source
928
 
929
 
929
@menu
930
@menu
930
* How can I compile R from source?::
931
* How can I compile R from source?::
931
* Can I use a fast BLAS?::
932
* Can I use a fast BLAS?::
932
* How do I include compiled C code?::
933
* How do I include compiled C code?::
933
* How do I debug code that I have compiled and dyn.load-ed?::
934
* How do I debug code that I have compiled and dyn.load-ed?::
934
* How do I include C++ code?::
935
* How do I include C++ code?::
935
* The output from my C code disappears.::
936
* The output from my C code disappears.::
936
* The output from my Fortran code disappears.::
937
* The output from my Fortran code disappears.::
937
* The console freezes when my compiled code is running::
938
* The console freezes when my compiled code is running::
938
@end menu
939
@end menu
939
 
940
 
940
 
941
 
941
@node How can I compile R from source?, Can I use a fast BLAS?, Building from Source, Building from Source
942
@node How can I compile R from source?, Can I use a fast BLAS?, Building from Source, Building from Source
942
@section How can I compile R from source?
943
@section How can I compile R from source?
943
 
944
 
944
Get the R sources.  Suppose you want to compile R-@value{RVERSION}.
945
Get the R sources.  Suppose you want to compile R-@value{RVERSION}.
945
Start in a directory whose path does not contain spaces, and run
946
Start in a directory whose path does not contain spaces, and run
946
 
947
 
947
@example
948
@example
948
tar zxvf R-@value{RVERSION}.tgz
949
tar zxvf R-@value{RVERSION}.tgz
949
cd R-@value{RVERSION}
950
cd R-@value{RVERSION}
950
cd src\gnuwin32
951
cd src\gnuwin32
951
@end example
952
@end example
952
@noindent
953
@noindent
953
Now read the @file{INSTALL} file and set up all the tools needed.  Then you
954
Now read the @file{INSTALL} file and set up all the tools needed.  Then you
954
can just use @code{make}, sit back and wait.  (A complete build takes about
955
can just use @code{make}, sit back and wait.  (A complete build takes about
955
5 minutes on a 2.4GHz P4 with a fast local disc.)
956
5 minutes on a 2.4GHz P4 with a fast local disc.)
956
 
957
 
957
You may need to compile under a case-honouring file system: we found
958
You may need to compile under a case-honouring file system: we found
958
that a @code{samba}-mounted file system (which maps all file names to lower
959
that a @code{samba}-mounted file system (which maps all file names to lower
959
case) did not work.
960
case) did not work.
960
 
961
 
961
@node Can I use a fast BLAS?, How do I include compiled C code?, How can I compile R from source?, Building from Source
962
@node Can I use a fast BLAS?, How do I include compiled C code?, How can I compile R from source?, Building from Source
962
@section  Can I use a fast BLAS?
963
@section  Can I use a fast BLAS?
963
 
964
 
964
Fast BLAS (Basic Linear Algebra Subprograms,
965
Fast BLAS (Basic Linear Algebra Subprograms,
965
@uref{http://www.netlib.org/blas/faq.html}) routines are used to speed
966
@uref{http://www.netlib.org/blas/faq.html}) routines are used to speed
966
up numerical linear algebra.  There is support in the R sources for the
967
up numerical linear algebra.  There is support in the R sources for the
967
`tuned' BLAS called ATLAS (@uref{http://math-atlas.sourceforge.net}).
968
`tuned' BLAS called ATLAS (@uref{http://math-atlas.sourceforge.net}).
968
The savings can be appreciable: on a 2.6GHz P4 and a 1000 x 1000 matrix
969
The savings can be appreciable: on a 2.6GHz P4 and a 1000 x 1000 matrix
969
@code{svd} took 16.2 sec with the standard BLAS and 7.8 sec with ATLAS.
970
@code{svd} took 16.2 sec with the standard BLAS and 7.8 sec with ATLAS.
970
Because ATLAS is tuned to a particular chip we can't use it generally:
971
Because ATLAS is tuned to a particular chip we can't use it generally:
971
the optimal routines for a PIII or an Athlon XP are quite different and
972
the optimal routines for a PIII or an Athlon XP are quite different and
972
neither will not run at all on a PII.
973
neither will not run at all on a PII.
973
 
974
 
974
BLAS support is supplied by the single DLL @file{R_HOME\bin\Rblas.dll},
975
BLAS support is supplied by the single DLL @file{R_HOME\bin\Rblas.dll},
975
and you can add a fast BLAS just by replacing that.  Replacements for
976
and you can add a fast BLAS just by replacing that.  Replacements for
976
some of the more common chips are available on CRAN in directory
977
some of the more common chips are available on CRAN in directory
977
@file{bin/windows/contrib/ATLAS}.
978
@file{bin/windows/contrib/ATLAS}.
978
 
979
 
979
If you are building R from source, in the file @file{MkRules} there
980
If you are building R from source, in the file @file{MkRules} there
980
are macros @code{USE_ATLAS} and @code{ATLAS_PATH}.  Set
981
are macros @code{USE_ATLAS} and @code{ATLAS_PATH}.  Set
981
@code{USE_ATLAS = YES} and @code{ATLAS_PATH} to where the ATLAS
982
@code{USE_ATLAS = YES} and @code{ATLAS_PATH} to where the ATLAS
982
libraries are located.  You will need to make the libraries yourself:
983
libraries are located.  You will need to make the libraries yourself:
983
none of the binaries we have seen are compiled for the correct
984
none of the binaries we have seen are compiled for the correct
984
compiler.
985
compiler.
985
 
986
 
986
Even faster hand-coded routines are available as DLLs from Kazushige
987
Even faster hand-coded routines are available as DLLs from Kazushige
987
Goto for certain CPUs (Pentium III and 4 and Opteron).  He does not
988
Goto for certain CPUs (Pentium III and 4 and Opteron).  He does not
988
allow redistribution: they are currently available @emph{via}
989
allow redistribution: they are currently available @emph{via}
989
@uref{http://www.cs.utexas.edu/users/kgoto/signup_first.html} and there
990
@uref{http://www.cs.utexas.edu/users/kgoto/signup_first.html} and there
990
is support in the R sources to build @file{R_HOME\bin\Rblas.dll} to link
991
is support in the R sources to build @file{R_HOME\bin\Rblas.dll} to link
991
to one of his DLLs.  On the @code{svd} problem they took 6.8 sec.
992
to one of his DLLs.  On the @code{svd} problem they took 6.8 sec.
992
 
993
 
993
 
994
 
994
@node  How do I include compiled C code?, How do I debug code that I have compiled and dyn.load-ed?, Can I use a fast BLAS?, Building from Source
995
@node  How do I include compiled C code?, How do I debug code that I have compiled and dyn.load-ed?, Can I use a fast BLAS?, Building from Source
995
@section How do I include compiled C code?
996
@section How do I include compiled C code?
996
 
997
 
997
We strongly encourage you to do this @emph{via} building an R package:
998
We strongly encourage you to do this @emph{via} building an R package:
998
see the @emph{`Writing R Extensions'} manual.  In any event you should
999
see the @emph{`Writing R Extensions'} manual.  In any event you should
999
install the parts of the R system for building R packages (in
1000
install the parts of the R system for building R packages (in
1000
@code{@RWVER@.exe}), and get and install the tools (including Perl) and
1001
@code{@RWVER@.exe}), and get and install the tools (including Perl) and
1001
compilers mentioned in the file @file{readme.packages} contained
1002
compilers mentioned in the file @file{readme.packages} contained
1002
therein.  Then you can use
1003
therein.  Then you can use
1003
@example
1004
@example
1004
...\bin\Rcmd SHLIB foo.c bar.f
1005
...\bin\Rcmd SHLIB foo.c bar.f
1005
@end example
1006
@end example
1006
@noindent
1007
@noindent
1007
to make @code{foo.dll}.  Use @code{...\bin\Rcmd SHLIB --help} for
1008
to make @code{foo.dll}.  Use @code{...\bin\Rcmd SHLIB --help} for
1008
further options, or see @code{?SHLIB}.
1009
further options, or see @code{?SHLIB}.
1009
 
1010
 
1010
If you want to use Visual C++, Borland C++ or other compilers, see the
1011
If you want to use Visual C++, Borland C++ or other compilers, see the
1011
appropriate section in @file{readme.packages}.
1012
appropriate section in @file{readme.packages}.
1012
 
1013
 
1013
 
1014
 
1014
 
1015
 
1015
@node How do I debug code that I have compiled and dyn.load-ed?, How do I include C++ code?, How do I include compiled C code?, Building from Source
1016
@node How do I debug code that I have compiled and dyn.load-ed?, How do I include C++ code?, How do I include compiled C code?, Building from Source
1016
@section How do I debug code that I have compiled and dyn.load-ed?
1017
@section How do I debug code that I have compiled and dyn.load-ed?
1017
 
1018
 
1018
You will need a suitable version of @code{gdb}: we normally use that
1019
You will need a suitable version of @code{gdb}: we normally use that
1019
from the Cygwin distribution.  Debugging under Windows is often a
1020
from the Cygwin distribution.  Debugging under Windows is often a
1020
fraught process, and sometimes does not work at all.  If all you need is
1021
fraught process, and sometimes does not work at all.  If all you need is
1021
a @emph{just-in-time} debugger to catch crashes, consider
1022
a @emph{just-in-time} debugger to catch crashes, consider
1022
@code{Dr. Mingw} from the @code{mingw-utils} bundle on
1023
@code{Dr. Mingw} from the @code{mingw-utils} bundle on
1023
@uref{http://www.mingw.org} (see also
1024
@uref{http://www.mingw.org} (see also
1024
@uref{http://jrfonseca.dyndns.org/projects/gnu-win32/software/drmingw/}).
1025
@uref{http://jrfonseca.dyndns.org/projects/gnu-win32/software/drmingw/}).
1025
That will be able to pinpoint the error, most effectively if you build a
1026
That will be able to pinpoint the error, most effectively if you build a
1026
version of R with debugging information as described below.
1027
version of R with debugging information as described below.
1027
 
1028
 
1028
First, build a version of the R system with debugging information by
1029
First, build a version of the R system with debugging information by
1029
 
1030
 
1030
@example
1031
@example
1031
make clean
1032
make clean
1032
make DEBUG=T
1033
make DEBUG=T
1033
@end example
1034
@end example
1034
@noindent
1035
@noindent
1035
 
1036
 
1036
and make a debug version of your package by
1037
and make a debug version of your package by
1037
 
1038
 
1038
@example
1039
@example
1039
make pkgclean-mypkg
1040
make pkgclean-mypkg
1040
make DEBUG=T pkg-mypkg
1041
make DEBUG=T pkg-mypkg
1041
@end example
1042
@end example
1042
@noindent
1043
@noindent
1043
 
1044
 
1044
Then you can debug by
1045
Then you can debug by
1045
 
1046
 
1046
@example
1047
@example
1047
gdb /path/to/@RWVER@/bin/Rgui.exe
1048
gdb /path/to/@RWVER@/bin/Rgui.exe
1048
@end example
1049
@end example
1049
@noindent
1050
@noindent
1050
 
1051
 
1051
However, note
1052
However, note
1052
 
1053
 
1053
@itemize @bullet
1054
@itemize @bullet
1054
@item
1055
@item
1055
@code{gdb} will only be able to find the source code if we run in the
1056
@code{gdb} will only be able to find the source code if we run in the
1056
location where the source was compiled (@code{@RWVER@/src/gnuwin32} for
1057
location where the source was compiled (@code{@RWVER@/src/gnuwin32} for
1057
the main system, @code{@RWVER@/src/library/mypkg/src} for a package),
1058
the main system, @code{@RWVER@/src/library/mypkg/src} for a package),
1058
unless told otherwise by the @code{directory} command.  It is most
1059
unless told otherwise by the @code{directory} command.  It is most
1059
convenient to set a list of code locations via @code{directory} commands
1060
convenient to set a list of code locations via @code{directory} commands
1060
in the file @file{.gdbinit} in the directory from which @code{gdb} is
1061
in the file @file{.gdbinit} in the directory from which @code{gdb} is
1061
run.
1062
run.
1062
 
1063
 
1063
@item
1064
@item
1064
It is only possible to set breakpoints in a DLL after the DLL has
1065
It is only possible to set breakpoints in a DLL after the DLL has
1065
been loaded.  So a way to examine the function @code{tukeyline} in
1066
been loaded.  So a way to examine the function @code{tukeyline} in
1066
package @code{eda} might be
1067
package @code{eda} might be
1067
 
1068
 
1068
@example
1069
@example
1069
     gdb ../../../../bin/Rgui.exe
1070
     gdb ../../../../bin/Rgui.exe
1070
     (gdb) break WinMain
1071
     (gdb) break WinMain
1071
     (gdb) run
1072
     (gdb) run
1072
     [ stops with R.dll loaded ]
1073
     [ stops with R.dll loaded ]
1073
     (gdb) break R_ReadConsole
1074
     (gdb) break R_ReadConsole
1074
     (gdb) continue
1075
     (gdb) continue
1075
     [ stops with console running ]
1076
     [ stops with console running ]
1076
     (gdb) continue
1077
     (gdb) continue
1077
     Rconsole> library(eda)
1078
     Rconsole> library(eda)
1078
     (gdb) break tukeyline
1079
     (gdb) break tukeyline
1079
     (gdb) clear R_ReadConsole
1080
     (gdb) clear R_ReadConsole
1080
     (gdb) continue
1081
     (gdb) continue
1081
@end example
1082
@end example
1082
 
1083
 
1083
Fortran symbols need an underline appended.
1084
Fortran symbols need an underline appended.
1084
 
1085
 
1085
@item
1086
@item
1086
Windows has little support for signals, so the usual idea of running a
1087
Windows has little support for signals, so the usual idea of running a
1087
program under a debugger and sending it a signal to interrupt it and
1088
program under a debugger and sending it a signal to interrupt it and
1088
drop control back to the debugger does not work with a @code{mingw}
1089
drop control back to the debugger does not work with a @code{mingw}
1089
version of @code{gdb}.  It does often work with the @code{cygwin} version.
1090
version of @code{gdb}.  It does often work with the @code{cygwin} version.
1090
 
1091
 
1091
@end itemize
1092
@end itemize
1092
 
1093
 
1093
 
1094
 
1094
@node  How do I include C++ code?, The output from my C code disappears., How do I debug code that I have compiled and dyn.load-ed?, Building from Source
1095
@node  How do I include C++ code?, The output from my C code disappears., How do I debug code that I have compiled and dyn.load-ed?, Building from Source
1095
@section  How do I include C++ code?
1096
@section  How do I include C++ code?
1096
 
1097
 
1097
You need to do two things:
1098
You need to do two things:
1098
 
1099
 
1099
(a) Write a wrapper to export the symbols you want to call from R as
1100
(a) Write a wrapper to export the symbols you want to call from R as
1100
 @code{extern "C"}.
1101
 @code{extern "C"}.
1101
 
1102
 
1102
(b) Include the C++ libraries in the link to make the DLL.  Suppose
1103
(b) Include the C++ libraries in the link to make the DLL.  Suppose
1103
@file{X.cc} contains your C++ code, and @file{X_main.cc} is the wrapper,
1104
@file{X.cc} contains your C++ code, and @file{X_main.cc} is the wrapper,
1104
as in the example in @emph{`Writing R Extensions'}.  Then build the DLL by
1105
as in the example in @emph{`Writing R Extensions'}.  Then build the DLL by
1105
(@code{gcc})
1106
(@code{gcc})
1106
 
1107
 
1107
@example
1108
@example
1108
...\bin\Rcmd SHLIB X.cc X_main.cc
1109
...\bin\Rcmd SHLIB X.cc X_main.cc
1109
@end example
1110
@end example
1110
@noindent
1111
@noindent
1111
or (VC++, which requires extension @code{.cpp})
1112
or (VC++, which requires extension @code{.cpp})
1112
 
1113
 
1113
@example
1114
@example
1114
cl /MT /c X.cpp X_main.cpp
1115
cl /MT /c X.cpp X_main.cpp
1115
link /dll /out:X.dll /export:X_main X.obj X_main.obj
1116
link /dll /out:X.dll /export:X_main X.obj X_main.obj
1116
@end example
1117
@end example
1117
@noindent
1118
@noindent
1118
or (Borland C++, which also requires extension @code{.cpp})
1119
or (Borland C++, which also requires extension @code{.cpp})
1119
 
1120
 
1120
@example
1121
@example
1121
bcc32 -u- -WDE X.cpp X_main.cpp
1122
bcc32 -u- -WDE X.cpp X_main.cpp
1122
@end example
1123
@end example
1123
@noindent
1124
@noindent
1124
and call the entry point(s) in @code{X_R}, such as @code{X_main}.
1125
and call the entry point(s) in @code{X_R}, such as @code{X_main}.
1125
Construction of static variables will occur when the DLL is loaded, and
1126
Construction of static variables will occur when the DLL is loaded, and
1126
destruction when the DLL is unloaded, usually when R terminates.
1127
destruction when the DLL is unloaded, usually when R terminates.
1127
 
1128
 
1128
Note that you will not see the messages from this example in the GUI
1129
Note that you will not see the messages from this example in the GUI
1129
console: see the next section.
1130
console: see the next section.
1130
 
1131
 
1131
This example is in package @code{cxx_0.0-x.tar.gz} in the
1132
This example is in package @code{cxx_0.0-x.tar.gz} in the
1132
@file{src/contrib/Devel} section on CRAN, and that can be compiled as a
1133
@file{src/contrib/Devel} section on CRAN, and that can be compiled as a
1133
package in the usual way on Windows.
1134
package in the usual way on Windows.
1134
 
1135
 
1135
 
1136
 
1136
@node  The output from my C code disappears., The output from my Fortran code disappears., How do I include C++ code?, Building from Source
1137
@node  The output from my C code disappears., The output from my Fortran code disappears., How do I include C++ code?, Building from Source
1137
@section  The output from my C code disappears.  Why?
1138
@section  The output from my C code disappears.  Why?
1138
 
1139
 
1139
The @code{Rgui.exe} console is a Windows application: writing to
1140
The @code{Rgui.exe} console is a Windows application: writing to
1140
@code{stdout} or @code{stderr} will not produce output in the
1141
@code{stdout} or @code{stderr} will not produce output in the
1141
console.  (This will work with @code{Rterm.exe}.)  Use @code{Rprintf} or
1142
console.  (This will work with @code{Rterm.exe}.)  Use @code{Rprintf} or
1142
@code{REprintf} instead.  These are declared in header file
1143
@code{REprintf} instead.  These are declared in header file
1143
@file{R_ext/PrtUtil.h}.
1144
@file{R_ext/PrtUtil.h}.
1144
 
1145
 
1145
Note that output from the console is delayed (@pxref{The output to the
1146
Note that output from the console is delayed (@pxref{The output to the
1146
console seems to be delayed}), so that you will not normally see any
1147
console seems to be delayed}), so that you will not normally see any
1147
output before returning to the R prompt.
1148
output before returning to the R prompt.
1148
 
1149
 
1149
 
1150
 
1150
@node  The output from my Fortran code disappears., The console freezes when my compiled code is running, The output from my C code disappears., Building from Source
1151
@node  The output from my Fortran code disappears., The console freezes when my compiled code is running, The output from my C code disappears., Building from Source
1151
@section  The output from my Fortran code disappears.  Why?
1152
@section  The output from my Fortran code disappears.  Why?
1152
 
1153
 
1153
Writing to Fortran output writes to a file, not the @code{Rgui} console.
1154
Writing to Fortran output writes to a file, not the @code{Rgui} console.
1154
Use one of the subroutines @code{dblepr}, @code{intpr} or @code{realpr}
1155
Use one of the subroutines @code{dblepr}, @code{intpr} or @code{realpr}
1155
documented in the @emph{`Writing R Extensions'} manual.
1156
documented in the @emph{`Writing R Extensions'} manual.
1156
 
1157
 
1157
Note that output from the console is delayed (@pxref{The output to the
1158
Note that output from the console is delayed (@pxref{The output to the
1158
console seems to be delayed}), so that you will not normally see any
1159
console seems to be delayed}), so that you will not normally see any
1159
output before returning to the R prompt even when using the @code{xxxpr}
1160
output before returning to the R prompt even when using the @code{xxxpr}
1160
subroutines.
1161
subroutines.
1161
 
1162
 
1162
 
1163
 
1163
@node  The console freezes when my compiled code is running,  , The output from my Fortran code disappears., Building from Source
1164
@node  The console freezes when my compiled code is running,  , The output from my Fortran code disappears., Building from Source
1164
@section The console freezes when my compiled code is running.
1165
@section The console freezes when my compiled code is running.
1165
 
1166
 
1166
The console, pagers and graphics window all run in the same thread
1167
The console, pagers and graphics window all run in the same thread
1167
as the R engine.  To allow the console etc to respond to Windows events,
1168
as the R engine.  To allow the console etc to respond to Windows events,
1168
call @code{R_ProcessEvents()} periodically from your compiled code.
1169
call @code{R_ProcessEvents()} periodically from your compiled code.
1169
If you want output to be updated on the console, call
1170
If you want output to be updated on the console, call
1170
@code{R_FlushConsole()} and then @code{R_ProcessEvents()}.
1171
@code{R_FlushConsole()} and then @code{R_ProcessEvents()}.
1171
 
1172
 
1172
 
1173
 
1173
@ifhtml
1174
@ifhtml
1174
@html
1175
@html
1175
<hr WIDTH="100%">
1176
<hr WIDTH="100%">
1176
<address>
1177
<address>
1177
Last edited 2004 January 20 by Professor B. D. Ripley
1178
Last edited 2004 January 20 by Professor B. D. Ripley
1178
<code><a href="mailto:ripley@@stats.ox.ac.uk">ripley@@stats.ox.ac.uk</a></code>
1179
<code><a href="mailto:ripley@@stats.ox.ac.uk">ripley@@stats.ox.ac.uk</a></code>
1179
</address>
1180
</address>
1180
@end html
1181
@end html
1181
@end ifhtml
1182
@end ifhtml
1182
@ifinfo
1183
@ifinfo
1183
@sp 2
1184
@sp 2
1184
Last edited 2004 January 20 by Professor B. D. Ripley <ripley@@stats.ox.ac.uk>
1185
Last edited 2004 January 20 by Professor B. D. Ripley <ripley@@stats.ox.ac.uk>
1185
@end ifinfo
1186
@end ifinfo
1186
 
1187
 
1187
@bye
1188
@bye
1188
 
1189
 
1189
@c Local Variables: ***
1190
@c Local Variables: ***
1190
@c mode: TeXinfo ***
1191
@c mode: TeXinfo ***
1191
@c End: ***
1192
@c End: ***