The R Project SVN R-packages

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
568 iacus 1
<html lang="en">
2
<head>
3
<title>R for Mac OS X FAQ</title>
4
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
5
<meta name="description" content="R for Mac OS X FAQ">
6
<meta name="generator" content="makeinfo 4.6">
7
<meta http-equiv="Content-Style-Type" content="text/css">
8
<style type="text/css"><!--
9
  pre.display { font-family:inherit }
10
  pre.format  { font-family:inherit }
11
  pre.smalldisplay { font-family:inherit; font-size:smaller }
12
  pre.smallformat  { font-family:inherit; font-size:smaller }
13
  pre.smallexample { font-size:smaller }
14
  pre.smalllisp    { font-size:smaller }
15
--></style>
16
</head>
17
<body>
18
<h1 class="settitle">R for Mac OS X FAQ</h1>
19
<div class="node">
20
<p><hr>
21
Node:&nbsp;<a name="Top">Top</a>,
22
Next:&nbsp;<a rel="next" accesskey="n" href="#Introduction">Introduction</a>,
23
Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
24
Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
25
<br>
26
</div>
27
 
28
<h2 class="unnumbered">R for Mac OS X FAQ</h2>
29
 
30
<h2>Frequently Asked Questions on R for Mac OS X</h2>
31
<h2>Version 2.0-0 2004-10-10</h2>
32
<address>Stefano M. Iacus</address>
33
<address>Simon Urbanek</address>
34
<p><p><hr><p>
35
 
36
<ul class="menu">
37
<li><a accesskey="1" href="#Introduction">Introduction</a>: 
38
<li><a accesskey="2" href="#Building%20R%20from%20sources">Building R from sources</a>: 
39
<li><a accesskey="3" href="#Command%20line%20version%20of%20R">Command line version of R</a>: 
40
<li><a accesskey="4" href="#R%20with%20Aqua%20GUI">R with Aqua GUI</a>: 
41
<li><a accesskey="5" href="#How%20to%20install%20packages">How to install packages</a>: 
42
<li><a accesskey="6" href="#R%20and%20external%20applications">R and external applications</a>: 
43
<li><a accesskey="7" href="#The%20near%20future%20of%20the%20Aqua%20GUI">The near future of the Aqua GUI</a>: 
44
<li><a accesskey="8" href="#Aqua%20GUI%20Bugs">Aqua GUI Bugs</a>: 
45
<li><a accesskey="9" href="#Quartz%20device">Quartz device</a>: 
46
<li><a href="#TclTk%20issues">TclTk issues</a>: 
47
<li><a href="#Additional%20resources">Additional resources</a>: 
48
<li><a href="#Acknowledgments">Acknowledgments</a>: 
49
<li><a href="#Sparse%20questions">Sparse questions</a>: 
50
</ul>
51
 
52
<div class="node">
53
<p><hr>
54
Node:&nbsp;<a name="Introduction">Introduction</a>,
55
Next:&nbsp;<a rel="next" accesskey="n" href="#Building%20R%20from%20sources">Building R from sources</a>,
56
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
57
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
58
<br>
59
</div>
60
 
61
<h2 class="chapter">Introduction</h2>
62
 
63
<p>This R for Mac OS X FAQ is rather incomplete at the moment and requires contributions from users. 
64
Anything specific to the R language can be found in the official R-FAQ (see  <a href="http://cran.r-project.org/doc/FAQ/R-FAQ.html">http://cran.r-project.org/doc/FAQ/R-FAQ.html</a>). 
65
Please send any requests/questions you would like answers on to the maintaniers.
66
 
67
   <p>This document contains information on how to build <small>R</small> from sources, how to install and run it. 
68
It also contains a user guide to the Aqua GUI version of <small>R</small>.
69
 
70
<ul class="menu">
71
<li><a accesskey="1" href="#How%20many%20versions%20of%20R%20for%20Mac%20OS%20X%3f">How many versions of R for Mac OS X?</a>: 
72
<li><a accesskey="2" href="#What%20machines%20does%20R%20for%20Mac%20OS%20X%20run%20on%3f">What machines does R for Mac OS X run on?</a>: 
73
<li><a accesskey="3" href="#How%20can%20R%20for%20Mac%20OS%20X%20be%20obtained%20and%20installed%3f">How can R for Mac OS X be obtained and installed?</a>: 
74
</ul>
75
 
76
<div class="node">
77
<p><hr>
78
Node:&nbsp;<a name="How%20many%20versions%20of%20R%20for%20Mac%20OS%20X%3f">How many versions of R for Mac OS X?</a>,
79
Next:&nbsp;<a rel="next" accesskey="n" href="#What%20machines%20does%20R%20for%20Mac%20OS%20X%20run%20on%3f">What machines does R for Mac OS X run on?</a>,
80
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
81
<br>
82
</div>
83
 
84
<h3 class="section">How many versions of R for Mac OS X?</h3>
85
 
86
<p>There is currently only one version of R for Mac OS X. 
87
But R on Mac OS X can be used as a command-line application (see <a href="#Command%20line%20version%20of%20R">Command line version of R</a>), like on any
88
other unix-like system, or via the Aqua GUI (see <a href="#R%20with%20Aqua%20GUI">R with Aqua GUI</a>). This second approach in using R
89
for Mac OS X is mostly preferred by "traditional" Macintosh users.
90
 
91
<div class="node">
92
<p><hr>
93
Node:&nbsp;<a name="What%20machines%20does%20R%20for%20Mac%20OS%20X%20run%20on%3f">What machines does R for Mac OS X run on?</a>,
94
Next:&nbsp;<a rel="next" accesskey="n" href="#How%20can%20R%20for%20Mac%20OS%20X%20be%20obtained%20and%20installed%3f">How can R for Mac OS X be obtained and installed?</a>,
95
Previous:&nbsp;<a rel="previous" accesskey="p" href="#How%20many%20versions%20of%20R%20for%20Mac%20OS%20X%3f">How many versions of R for Mac OS X?</a>,
96
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
97
<br>
98
</div>
99
 
100
<h3 class="section">What machines does R for Mac OS X run on?</h3>
101
 
102
<p>R for Mac OS X requires Mac OS X version 10.2 or higher to run. The latest version of the system is
103
always preferable though. We do not support Mac OS X version 10.1.
104
 
105
<div class="node">
106
<p><hr>
107
Node:&nbsp;<a name="How%20can%20R%20for%20Mac%20OS%20X%20be%20obtained%20and%20installed%3f">How can R for Mac OS X be obtained and installed?</a>,
108
Previous:&nbsp;<a rel="previous" accesskey="p" href="#What%20machines%20does%20R%20for%20Mac%20OS%20X%20run%20on%3f">What machines does R for Mac OS X run on?</a>,
109
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
110
<br>
111
</div>
112
 
113
<h3 class="section">How can R for Mac OS X be obtained and installed?</h3>
114
 
115
<div class="node">
116
<p><hr>
117
Node:&nbsp;<a name="Building%20R%20from%20sources">Building R from sources</a>,
118
Next:&nbsp;<a rel="next" accesskey="n" href="#Command%20line%20version%20of%20R">Command line version of R</a>,
119
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Introduction">Introduction</a>,
120
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
121
<br>
122
</div>
123
 
124
<h2 class="chapter">Building R from sources</h2>
125
 
126
<ul class="menu">
127
<li><a accesskey="1" href="#What%20is%20needed%20to%20build%20R">What is needed to build R</a>: 
128
<li><a accesskey="2" href="#How%20to%20configure%20and%20build%20R">How to configure and build R</a>: 
129
<li><a accesskey="3" href="#How%20to%20install%20R">How to install R</a>: 
130
<li><a accesskey="4" href="#How%20to%20build%20and%20install%20the%20Aqua%20GUI">How to build and install the Aqua GUI</a>: 
131
</ul>
132
 
133
<div class="node">
134
<p><hr>
135
Node:&nbsp;<a name="What%20is%20needed%20to%20build%20R">What is needed to build R</a>,
136
Next:&nbsp;<a rel="next" accesskey="n" href="#How%20to%20configure%20and%20build%20R">How to configure and build R</a>,
137
Up:&nbsp;<a rel="up" accesskey="u" href="#Building%20R%20from%20sources">Building R from sources</a>
138
<br>
139
</div>
140
 
141
<h3 class="section">What is needed to build R</h3>
142
 
143
<ul class="menu">
144
<li><a accesskey="1" href="#the%20C%2fC++%20compiler%20gcc%203.3">the C/C++ compiler gcc 3.3</a>: 
145
<li><a accesskey="2" href="#the%20Fortran%20compiler%20g77%20for%20gcc%203.3">the Fortran compiler g77 for gcc 3.3</a>: 
146
<li><a accesskey="3" href="#the%20libreadline%204.3%20(optional)">the libreadline 4.3 (optional)</a>: 
147
<li><a accesskey="4" href="#the%20X11%20window%20server%20(optional)">the X11 window server (optional)</a>: 
148
<li><a accesskey="5" href="#the%20X11%20TclTk%20headers%20and%20libraries%20(optional)">the X11 TclTk headers and libraries (optional)</a>: 
149
<li><a accesskey="6" href="#the%20Aqua%20TclTk%20headers%20and%20libraries%20(optional)">the Aqua TclTk headers and libraries (optional)</a>: 
150
<li><a accesskey="7" href="#a%20TeX%20suite%20of%20tools%20for%20documentation%20(optional)">a TeX suite of tools for documentation (optional)</a>: 
151
</ul>
152
 
153
<div class="node">
154
<p><hr>
155
Node:&nbsp;<a name="the%20C%2fC++%20compiler%20gcc%203.3">the C/C++ compiler gcc 3.3</a>,
156
Next:&nbsp;<a rel="next" accesskey="n" href="#the%20Fortran%20compiler%20g77%20for%20gcc%203.3">the Fortran compiler g77 for gcc 3.3</a>,
157
Up:&nbsp;<a rel="up" accesskey="u" href="#What%20is%20needed%20to%20build%20R">What is needed to build R</a>
158
<br>
159
</div>
160
 
161
<h3 class="subsection">the C/C++ compiler gcc 3.3</h4>
162
 
163
<p>If you have Mac OS X 10.3 (aka Panther) you just need to install the software inside the Xcode Tools CD
164
(which is CD number 4). This is only true if you bought Panther. In most of the cases you have
165
Panther already installed on your brand new machine, which means that you don't have the forth
166
Developer CD. You should take it from Apple Developer Connection site (see <a href="#Apple%20Developer%20Connection">Apple Developer Connection</a>): in the
167
download section, look for Xcode Tools v 1.1 or above.
168
 
169
   <p>If you are using Mac OS X 10.2 (aka Jaguar) then you should download and install the
170
Apple Developers Tools Dec 2002 including the latest updates which dates August 2003. Either it comes
171
on a separate CD with your Mac, either you can download these  from the Apple Developer Connection site (see <a href="#Apple%20Developer%20Connection">Apple Developer Connection</a>)
172
In either cases be sure you have gcc version 3.3 just by typing in a Terminal window
173
<pre class="example">     gcc -vv
174
     </pre>
175
 
176
<div class="node">
177
<p><hr>
178
Node:&nbsp;<a name="the%20Fortran%20compiler%20g77%20for%20gcc%203.3">the Fortran compiler g77 for gcc 3.3</a>,
179
Next:&nbsp;<a rel="next" accesskey="n" href="#the%20libreadline%204.3%20(optional)">the libreadline 4.3 (optional)</a>,
180
Previous:&nbsp;<a rel="previous" accesskey="p" href="#the%20C%2fC++%20compiler%20gcc%203.3">the C/C++ compiler gcc 3.3</a>,
181
Up:&nbsp;<a rel="up" accesskey="u" href="#What%20is%20needed%20to%20build%20R">What is needed to build R</a>
182
<br>
183
</div>
184
 
185
<h3 class="subsection">the Fortran compiler g77 for gcc 3.3</h4>
186
 
187
<p>You need to install a version of the g77 Fortran compiler which is built for gcc 3.3. 
188
The following instructions apply to binaries coming from  HPC for Mac OS X page <a href="http://hpc.sourceforge.net">http://hpc.sourceforge.net</a>. 
189
Please take care: there are two versions of the g77 binaries, one for Jaguar and one for Panther. 
190
Use the appropriate one.
191
 
192
   <p>Once you have the binaries, please do the following (you'll be asked for a root password):
193
cd to the download folder and type
194
<pre class="example">     sudo tar -zxvf g77v3.4-bin.tar.gz -C /
195
     rehash
196
     </pre>
197
   It installs everything in <em>/usr/local</em>. The name of the .tar.gz archive can be different, see the related web page.
198
 
199
<div class="node">
200
<p><hr>
201
Node:&nbsp;<a name="the%20libreadline%204.3%20(optional)">the libreadline 4.3 (optional)</a>,
202
Next:&nbsp;<a rel="next" accesskey="n" href="#the%20X11%20window%20server%20(optional)">the X11 window server (optional)</a>,
203
Previous:&nbsp;<a rel="previous" accesskey="p" href="#the%20Fortran%20compiler%20g77%20for%20gcc%203.3">the Fortran compiler g77 for gcc 3.3</a>,
204
Up:&nbsp;<a rel="up" accesskey="u" href="#What%20is%20needed%20to%20build%20R">What is needed to build R</a>
205
<br>
206
</div>
207
 
208
<h3 class="subsection">the libreadline 4.3 (optional)</h4>
209
 
210
<p>This library is optional. 
211
You need this library to be able to retrieve history using use arrow keys or for tab completion of filenames
212
when you run R as a command line tool. The original source archive is located at GNU Org web page <a href="ftp://www.gnu.org">ftp://www.gnu.org</a>. 
213
You need to modify the original file <em>shlib/Makefile.in</em> in order to make it
214
work under Mac OS X 10.2.x and later (this is because libreadline needs to be linked against
215
<em>-lncurses -lcc_dynamic</em>). If you can do better at configure time working on the original archive
216
let me know. I suggest you to download my patched version from <a href="http://www.economia.unimi.it/R">http://www.economia.unimi.it/R</a>. 
217
Once you have done, please do the following (you'll be asked for a root password):
218
uncompress the archive, cd inside the folder and type the following
219
<pre class="example">     ./configure
220
     make
221
     sudo make install
222
     </pre>
223
   It installs everything in <em>/usr/local</em>. 
224
These instructions apply to both Jaguar and Panther.
225
 
226
<div class="node">
227
<p><hr>
228
Node:&nbsp;<a name="the%20X11%20window%20server%20(optional)">the X11 window server (optional)</a>,
229
Next:&nbsp;<a rel="next" accesskey="n" href="#the%20X11%20TclTk%20headers%20and%20libraries%20(optional)">the X11 TclTk headers and libraries (optional)</a>,
230
Previous:&nbsp;<a rel="previous" accesskey="p" href="#the%20libreadline%204.3%20(optional)">the libreadline 4.3 (optional)</a>,
231
Up:&nbsp;<a rel="up" accesskey="u" href="#What%20is%20needed%20to%20build%20R">What is needed to build R</a>
232
<br>
233
</div>
234
 
235
<h3 class="subsection">the X11 window server (optional)</h4>
236
 
237
<p>If you have Panther, you probably have the X11 Window server already installed on your system. 
238
This is what you need to run a version of R with the capability of using the X11 device, but it isn't sufficient
239
if you want to build it. 
240
You need to install the additional X11 SDK package from the Xcode Tools CD. 
241
Please note: the installer on the Xcode Tools CD does not install the X11 SDK by default:
242
you should look inside the Xcode Tools CD and install manually the X11 SDK.
243
 
244
   <p>If you have Jaguar, you'll need to install both the X11 Window server and the X11 SDK package from
245
the XFree86 web page.  Apple site only supports the latest version of his OS (at the moment Panther). 
246
Users report that other version of X11 Window Servers (other than the one distributed by Apple) work as well.
247
 
248
<div class="node">
249
<p><hr>
250
Node:&nbsp;<a name="the%20X11%20TclTk%20headers%20and%20libraries%20(optional)">the X11 TclTk headers and libraries (optional)</a>,
251
Next:&nbsp;<a rel="next" accesskey="n" href="#the%20Aqua%20TclTk%20headers%20and%20libraries%20(optional)">the Aqua TclTk headers and libraries (optional)</a>,
252
Previous:&nbsp;<a rel="previous" accesskey="p" href="#the%20X11%20window%20server%20(optional)">the X11 window server (optional)</a>,
253
Up:&nbsp;<a rel="up" accesskey="u" href="#What%20is%20needed%20to%20build%20R">What is needed to build R</a>
254
<br>
255
</div>
256
 
257
<h3 class="subsection">the X11 TclTk headers and libraries (optional)</h4>
258
 
259
<p>You need to download the sources of the Tcl and Tk 8.4.x packages to build yourself the sources. 
260
The original sources can be found on the official TclTk web page <a href="http://www.tcl.tk/software/tcltk/8.4.html">http://www.tcl.tk/software/tcltk/8.4.html</a>. 
261
Please do the following respecting the sequence (you'll be asked for a root password). These are examples for version 8.4.4
262
of the Tcl and Tk sources, you'll probably find new version on the web page, thus only the name of the .tar.gz archives
263
changes.
264
 
265
   <p>For Tcl: download the tlc 8.4 sources, cd inside the folder where you have downloaded the archive and
266
type:
267
<pre class="example">     tar zxf tcl8.4.4-src.tar.gz
268
     cd tcl8.4.4/unix/
269
     ./configure
270
     make
271
     sudo make install
272
     </pre>
273
 
274
   <p>For Tk: download the tk 8.4 sources, cd inside the folder where you have downloaded the archive and type:
275
<pre class="example">     tar zxf tk8.4.4-src.tar.gz
276
     cd tk8.4.4/unix/
277
     ./configure
278
     make
279
     sudo make install
280
     </pre>
281
 
282
<div class="node">
283
<p><hr>
284
Node:&nbsp;<a name="the%20Aqua%20TclTk%20headers%20and%20libraries%20(optional)">the Aqua TclTk headers and libraries (optional)</a>,
285
Next:&nbsp;<a rel="next" accesskey="n" href="#a%20TeX%20suite%20of%20tools%20for%20documentation%20(optional)">a TeX suite of tools for documentation (optional)</a>,
286
Previous:&nbsp;<a rel="previous" accesskey="p" href="#the%20X11%20TclTk%20headers%20and%20libraries%20(optional)">the X11 TclTk headers and libraries (optional)</a>,
287
Up:&nbsp;<a rel="up" accesskey="u" href="#What%20is%20needed%20to%20build%20R">What is needed to build R</a>
288
<br>
289
</div>
290
 
291
<h3 class="subsection">the Aqua TclTk headers and libraries (optional)</h4>
292
 
293
<p>Once you have installed the AquaTclTk libraries and headers files you should configure <small>R</small> using this additional
294
arguments
295
<pre class="example">     --with-tcl-config=/Library/Frameworks/Tcl.framework/tclConfig.sh
296
     --with-tk-config=/Library/Frameworks/Tk.framework/tkConfig.sh
297
     TCLTK_LIBS='-framework Tcl -framework Tk'
298
     TCLTK_CPPFLAGS='-I/Library/Frameworks/Tcl.Framework/Headers -I/Library/Frameworks/Tk.Framework/Headers'
299
     </pre>
300
 
301
<div class="node">
302
<p><hr>
303
Node:&nbsp;<a name="a%20TeX%20suite%20of%20tools%20for%20documentation%20(optional)">a TeX suite of tools for documentation (optional)</a>,
304
Previous:&nbsp;<a rel="previous" accesskey="p" href="#the%20Aqua%20TclTk%20headers%20and%20libraries%20(optional)">the Aqua TclTk headers and libraries (optional)</a>,
305
Up:&nbsp;<a rel="up" accesskey="u" href="#What%20is%20needed%20to%20build%20R">What is needed to build R</a>
306
<br>
307
</div>
308
 
309
<h3 class="subsection">a TeX suite of tools for documentation (optional)</h4>
310
 
311
<p>There is a nice installer, called the i-installer II, that allows you to install a complete
312
teTeX distribution. You can find details on the i-installer at <a href="http://www.rna.nl/ii.html">http://www.rna.nl/ii.html</a>. 
313
The teTeX is one of the i-Packages.
314
 
315
<div class="node">
316
<p><hr>
317
Node:&nbsp;<a name="How%20to%20configure%20and%20build%20R">How to configure and build R</a>,
318
Next:&nbsp;<a rel="next" accesskey="n" href="#How%20to%20install%20R">How to install R</a>,
319
Previous:&nbsp;<a rel="previous" accesskey="p" href="#What%20is%20needed%20to%20build%20R">What is needed to build R</a>,
320
Up:&nbsp;<a rel="up" accesskey="u" href="#Building%20R%20from%20sources">Building R from sources</a>
321
<br>
322
</div>
323
 
324
<h3 class="section">How to configure and build R</h3>
325
 
326
<p>Download the latest sources of R from <small>CRAN</small>. Unpack the archive with tar -zxf <em>name_of_R_sources_archive</em> and cd
327
inside the R sources directory. Then you need to configure R for your system and build R. 
328
Just type
329
<pre class="example">     ./configure --with-blas='-framework vecLib' --with-lapack --with-aqua
330
     make
331
     </pre>
332
   This will configure R to be built as a Framework to be installed inside your <em>/Library/Frameworks</em> directory with the name
333
<em>R.framework</em>. You can change the default location of the <em>R.framework</em>
334
installation at configure time by specifying the flag <em>-enable-R-framework[=DIR]</em>, i.e. 
335
with something like
336
<pre class="example">     ./configure --with-blas='-framework vecLib' --with-lapack
337
                 --with-aqua --enable-R-framework=FOO
338
     </pre>
339
   and the final destination of the <em>R.framework</em> will be <em>FOO/R.framework</em>, which means that you
340
don't have to specify the <em>R.framework</em> text in the path.
341
 
342
<div class="node">
343
<p><hr>
344
Node:&nbsp;<a name="How%20to%20install%20R">How to install R</a>,
345
Next:&nbsp;<a rel="next" accesskey="n" href="#How%20to%20build%20and%20install%20the%20Aqua%20GUI">How to build and install the Aqua GUI</a>,
346
Previous:&nbsp;<a rel="previous" accesskey="p" href="#How%20to%20configure%20and%20build%20R">How to configure and build R</a>,
347
Up:&nbsp;<a rel="up" accesskey="u" href="#Building%20R%20from%20sources">Building R from sources</a>
348
<br>
349
</div>
350
 
351
<h3 class="section">How to install R</h3>
352
 
353
<p>A standard installation of R requires you have built it as a Framework. At this point just type (a root
354
password will be required):
355
<pre class="example">     sudo make install
356
     </pre>
357
   and all will be installed in <em>/Library/Frameworks</em>. 
358
You can decide to change the R.framework destination by using the <em>prefix</em> option specifying the
359
final destination.
360
<pre class="smallexample">     sudo make prefix=/where/you/want/R.framework/to/go install
361
     </pre>
362
   As in the above, you don't need to specify the name <em>R.framework</em> in the path.
363
 
364
<div class="node">
365
<p><hr>
366
Node:&nbsp;<a name="How%20to%20build%20and%20install%20the%20Aqua%20GUI">How to build and install the Aqua GUI</a>,
367
Previous:&nbsp;<a rel="previous" accesskey="p" href="#How%20to%20install%20R">How to install R</a>,
368
Up:&nbsp;<a rel="up" accesskey="u" href="#Building%20R%20from%20sources">Building R from sources</a>
369
<br>
370
</div>
371
 
372
<h3 class="section">How to build and install the Aqua GUI</h3>
373
 
374
<p>At the moment, there is nothing special to  do to build the Aqua GUI. 
375
You just need to install it using
376
<pre class="example">     make install-aqua
377
     </pre>
378
   and it will install the <em>R.app</em> application in the <em>Applications</em> folder on your system. 
379
The install procedure fails if the <code>R.framework</code> has not been installed first.
380
 
381
<div class="node">
382
<p><hr>
383
Node:&nbsp;<a name="Command%20line%20version%20of%20R">Command line version of R</a>,
384
Next:&nbsp;<a rel="next" accesskey="n" href="#R%20with%20Aqua%20GUI">R with Aqua GUI</a>,
385
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Building%20R%20from%20sources">Building R from sources</a>,
386
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
387
<br>
388
</div>
389
 
390
<h2 class="chapter">Command line version of R</h2>
391
 
392
<p>The command line version of <small>R</small> is nothing but a classic unix-like implementation of <small>R</small>. So general
393
documentation for <small>R</small> applies to this version as well. 
394
On each release (and patched-release) ready to use binaries are distributed through <small>CRAN</small>. 
395
These binaries come with a common installer used by R with Aqua GUI so please read
396
the related notes (see <a href="#How%20to%20get%20R%20with%20Aqua%20GUI">How to get R with Aqua GUI</a>). 
397
To use <small>R</small> you probably need to add a symbolic link on your System as the <small>R</small> binary is
398
located inside the framework. 
399
Suppose you have the <em>/usr/local/bin</em> directory on your System, than you should just
400
type in your Terminal (a root password is required)
401
<pre class="smallexample">     sudo ln -s /Library/Frameworks/R.framework/Resources/R /usr/local/bin/R
402
     </pre>
403
   Assuming that you have <em>/usr/local/bin</em> in your <em>PATH</em> environment variable, you'll be able to launch R from any location
404
on your System just by typing <em>R</em>. 
405
In this way, when you install a new version of the <em>R.framework</em> this link will point to the latest R binary.
406
 
407
<div class="node">
408
<p><hr>
409
Node:&nbsp;<a name="R%20with%20Aqua%20GUI">R with Aqua GUI</a>,
410
Next:&nbsp;<a rel="next" accesskey="n" href="#How%20to%20install%20packages">How to install packages</a>,
411
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Command%20line%20version%20of%20R">Command line version of R</a>,
412
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
413
<br>
414
</div>
415
 
416
<h2 class="chapter">R with Aqua GUI</h2>
417
 
418
<ul class="menu">
419
<li><a accesskey="1" href="#How%20to%20get%20R%20with%20Aqua%20GUI">How to get R with Aqua GUI</a>: 
420
<li><a accesskey="2" href="#How%20to%20install%20the%20Aqua%20GUI">How to install the Aqua GUI</a>: 
421
<li><a accesskey="3" href="#The%20R%20Console">The R Console</a>: 
422
<li><a accesskey="4" href="#The%20Menus">The Menus</a>: 
423
<li><a accesskey="5" href="#Preferences">Preferences</a>: 
424
<li><a accesskey="6" href="#The%20near%20future%20of%20the%20Aqua%20GUI">The near future of the Aqua GUI</a>: 
425
<li><a accesskey="7" href="#Aqua%20GUI%20Bugs">Aqua GUI Bugs</a>: 
426
</ul>
427
 
428
<div class="node">
429
<p><hr>
430
Node:&nbsp;<a name="How%20to%20get%20R%20with%20Aqua%20GUI">How to get R with Aqua GUI</a>,
431
Next:&nbsp;<a rel="next" accesskey="n" href="#How%20to%20install%20the%20Aqua%20GUI">How to install the Aqua GUI</a>,
432
Up:&nbsp;<a rel="up" accesskey="u" href="#R%20with%20Aqua%20GUI">R with Aqua GUI</a>
433
<br>
434
</div>
435
 
436
<h3 class="section">How to get R with Aqua GUI</h3>
437
 
438
<p>The <code>bin/macosx</code> directory of a <small>CRAN</small> site contains a standard
439
Apple installer package named <code>R.dmg.sit</code> compressed in Aladdin
440
Stuffit format.  Once downloaded, uncompressed and executed, the
441
installer will install the current non-developer release of R.  R  is
442
a native Mac OS X Darwin version of R with an Aqua GUI. 
443
Inside
444
<code>bin/macosx/</code><var>x</var><code>.</code><var>y</var><code></code> there are prebuilt binary packages to
445
be used with R corresponding to the "<var>x</var>.<var>y</var>" release of
446
R. The installation of these packages is available through the
447
"Package" menu of the Aqua GUI (see <a href="#Packages%20Menu">Packages Menu</a>).
448
 
449
<div class="node">
450
<p><hr>
451
Node:&nbsp;<a name="How%20to%20install%20the%20Aqua%20GUI">How to install the Aqua GUI</a>,
452
Next:&nbsp;<a rel="next" accesskey="n" href="#The%20R%20Console">The R Console</a>,
453
Previous:&nbsp;<a rel="previous" accesskey="p" href="#How%20to%20get%20R%20with%20Aqua%20GUI">How to get R with Aqua GUI</a>,
454
Up:&nbsp;<a rel="up" accesskey="u" href="#R%20with%20Aqua%20GUI">R with Aqua GUI</a>
455
<br>
456
</div>
457
 
458
<h3 class="section">How to install the Aqua GUI</h3>
459
 
460
<div class="node">
461
<p><hr>
462
Node:&nbsp;<a name="The%20R%20Console">The R Console</a>,
463
Next:&nbsp;<a rel="next" accesskey="n" href="#The%20Menus">The Menus</a>,
464
Previous:&nbsp;<a rel="previous" accesskey="p" href="#How%20to%20install%20the%20Aqua%20GUI">How to install the Aqua GUI</a>,
465
Up:&nbsp;<a rel="up" accesskey="u" href="#R%20with%20Aqua%20GUI">R with Aqua GUI</a>
466
<br>
467
</div>
468
 
469
<h3 class="section">The R Console</h3>
470
 
471
<p>In this section you'll find general informations on the Aqua GUI. For specific <small>R</small> tasks that
472
can be done via the Aqua GUI using menus you should read below (see <a href="#The%20Menus">The Menus</a>).
473
 
474
<ul class="menu">
475
<li><a accesskey="1" href="#The%20Input%20and%20the%20Output">The Input and the Output</a>: 
476
<li><a accesskey="2" href="#Copy%20and%20Paste">Copy and Paste</a>: 
477
<li><a accesskey="3" href="#The%20current%20and%20startup%20working%20directories">The current and startup working directories</a>: 
478
<li><a accesskey="4" href="#Resizing%20the%20R%20Console">Resizing the R Console</a>: 
479
<li><a accesskey="5" href="#Input%20and%20Output%20text%20colors">Input and Output text colors</a>: 
480
</ul>
481
 
482
<div class="node">
483
<p><hr>
484
Node:&nbsp;<a name="The%20Input%20and%20the%20Output">The Input and the Output</a>,
485
Next:&nbsp;<a rel="next" accesskey="n" href="#Copy%20and%20Paste">Copy and Paste</a>,
486
Up:&nbsp;<a rel="up" accesskey="u" href="#The%20R%20Console">The R Console</a>
487
<br>
488
</div>
489
 
490
<h3 class="subsection">The Input and the Output</h4>
491
 
492
<p>The current design of the R Console is to have separate frames for input (user) and output (R). 
493
The user is supposed to type command into the bottom frame of the R Console, this input is echoed
494
into the upper frame and R will give any related output in the upper frame. 
495
The output frame (the upper one) is a read-only frame.
496
 
497
<div class="node">
498
<p><hr>
499
Node:&nbsp;<a name="Copy%20and%20Paste">Copy and Paste</a>,
500
Next:&nbsp;<a rel="next" accesskey="n" href="#The%20current%20and%20startup%20working%20directories">The current and startup working directories</a>,
501
Previous:&nbsp;<a rel="previous" accesskey="p" href="#The%20Input%20and%20the%20Output">The Input and the Output</a>,
502
Up:&nbsp;<a rel="up" accesskey="u" href="#The%20R%20Console">The R Console</a>
503
<br>
504
</div>
505
 
506
<h3 class="subsection">Copy and Paste</h4>
507
 
508
<p>Copy and paste works in R as in any other Macintosh application. 
509
But when two selection are active: one in the output frame and one in the input frame, the output frame takes precedence
510
when copying to the clipboard. 
511
You can also copy from the <em>quartz()</em> graphic device (see <a href="#Quartz%20device">Quartz device</a>) to the clipboard. In this case a bitmap image is
512
created. If you want high resolution graphic exports, you should better save the image using the <em>File/Save as</em> menu item (see <a href="#Quartz%20device">Quartz device</a>).
513
 
514
<div class="node">
515
<p><hr>
516
Node:&nbsp;<a name="The%20current%20and%20startup%20working%20directories">The current and startup working directories</a>,
517
Next:&nbsp;<a rel="next" accesskey="n" href="#Resizing%20the%20R%20Console">Resizing the R Console</a>,
518
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Copy%20and%20Paste">Copy and Paste</a>,
519
Up:&nbsp;<a rel="up" accesskey="u" href="#The%20R%20Console">The R Console</a>
520
<br>
521
</div>
522
 
523
<h3 class="subsection">The current and startup working directories</h4>
524
 
525
<p>If not otherwise specified in the Preferences (see <a href="#Preferences">Preferences</a>), or if the specified path is no longer available, then
526
the default working directory at startup is the user home. 
527
The working directory can be changed using the <em>setwd</em> R command or using the <em>Tools</em> menu item <em>Change working directory</em>. 
528
The current working directory is displayed on the main bar of the R Console window.
529
 
530
<p>This feature is useful if you want different startup procedures defined by the <code>.Rprofile</code>; you can
531
edit a <code>.Rprofile</code> (containing you personal initialization <small>R</small> commands) in a particular directory and use
532
the Preferences to change the startup directory. Next time you launch <code>R.app</code> the <code>.Rprofile</code> is read and executed
533
by <small>R</small> at startup. This is the equivalent on Unix (or the command line) to launch <small>R</small> from different directories.
534
 
535
<div class="node">
536
<p><hr>
537
Node:&nbsp;<a name="Resizing%20the%20R%20Console">Resizing the R Console</a>,
538
Next:&nbsp;<a rel="next" accesskey="n" href="#Input%20and%20Output%20text%20colors">Input and Output text colors</a>,
539
Previous:&nbsp;<a rel="previous" accesskey="p" href="#The%20current%20and%20startup%20working%20directories">The current and startup working directories</a>,
540
Up:&nbsp;<a rel="up" accesskey="u" href="#The%20R%20Console">The R Console</a>
541
<br>
542
</div>
543
 
544
<h3 class="subsection">Resizing the R Console</h4>
545
 
546
<p>When the R Console Window is resized, the R option <em>width</em> is set appropriately so that any future
547
output will fit the window size. This behavior can be inhibited using the Preferences settings (see <a href="#Preferences">Preferences</a>). 
548
On closing the R application, the position and the size of the R Console window are saved in the Preferences and reused
549
next time you launch R. You can inhibit R to do this using the appropriate Preferences settings.
550
 
551
<div class="node">
552
<p><hr>
553
Node:&nbsp;<a name="Input%20and%20Output%20text%20colors">Input and Output text colors</a>,
554
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Resizing%20the%20R%20Console">Resizing the R Console</a>,
555
Up:&nbsp;<a rel="up" accesskey="u" href="#The%20R%20Console">The R Console</a>
556
<br>
557
</div>
558
 
559
<h3 class="subsection">Input and Output text colors</h4>
560
 
561
<p>Text windows and frames are divided in Read-Only and Read and Write ones. Text colors can be set separately
562
for the two kinds of windows. This happens as well for their respective backgrounds. Use the Preferences window to set these
563
colors (see <a href="#Preferences">Preferences</a>).
564
 
565
<div class="node">
566
<p><hr>
567
Node:&nbsp;<a name="The%20Menus">The Menus</a>,
568
Next:&nbsp;<a rel="next" accesskey="n" href="#Preferences">Preferences</a>,
569
Previous:&nbsp;<a rel="previous" accesskey="p" href="#The%20R%20Console">The R Console</a>,
570
Up:&nbsp;<a rel="up" accesskey="u" href="#R%20with%20Aqua%20GUI">R with Aqua GUI</a>
571
<br>
572
</div>
573
 
574
<h3 class="section">The Menus</h3>
575
 
576
<ul class="menu">
577
<li><a accesskey="1" href="#Application%20Menu">Application Menu</a>: 
578
<li><a accesskey="2" href="#File%20Menu">File Menu</a>: 
579
<li><a accesskey="3" href="#Edit%20Menu">Edit Menu</a>: 
580
<li><a accesskey="4" href="#Tools%20Menu">Tools Menu</a>: 
581
<li><a accesskey="5" href="#Workspace%20Menu">Workspace Menu</a>: 
582
<li><a accesskey="6" href="#Packages%20Menu">Packages Menu</a>: 
583
<li><a accesskey="7" href="#The%20Help%20Menu">The Help Menu</a>: 
584
</ul>
585
 
586
<div class="node">
587
<p><hr>
588
Node:&nbsp;<a name="Application%20Menu">Application Menu</a>,
589
Next:&nbsp;<a rel="next" accesskey="n" href="#File%20Menu">File Menu</a>,
590
Up:&nbsp;<a rel="up" accesskey="u" href="#The%20Menus">The Menus</a>
591
<br>
592
</div>
593
 
594
<h3 class="subsection">Application Menu</h4>
595
 
596
<p>The Application menu is the first one after the main Apple Menu. In Mac OS X 10.3 it reports the name R.bin under Mac OS X 10.2 it is just R (as it should be). 
597
We are not able to fix this behavior at the moment.
598
 
599
   <p>With this menu you can access three items: 1. the About box, which tells you which version of R is currently in use, 2. Check for updates, which search on <small>CRAN</small> if a new version
600
of the binary distribution of <small>R</small> for Mac OS X is available (you need an internet connection), 3. you can access the Preferences (see <a href="#Preferences">Preferences</a>).
601
 
602
<div class="node">
603
<p><hr>
604
Node:&nbsp;<a name="File%20Menu">File Menu</a>,
605
Next:&nbsp;<a rel="next" accesskey="n" href="#Edit%20Menu">Edit Menu</a>,
606
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Application%20Menu">Application Menu</a>,
607
Up:&nbsp;<a rel="up" accesskey="u" href="#The%20Menus">The Menus</a>
608
<br>
609
</div>
610
 
611
<h3 class="subsection">File Menu</h4>
612
 
613
<p>This menu provides standard functionalities. 
614
The <em>open</em> command is associated to the action  <em>Source </em><small>R</small><em> code</em>, which means that you can select a file, which is a script, and it will be executed
615
in <small>R</small>. This is a interface to the <small>R</small> source command <code>source</code>.
616
 
617
<div class="node">
618
<p><hr>
619
Node:&nbsp;<a name="Edit%20Menu">Edit Menu</a>,
620
Next:&nbsp;<a rel="next" accesskey="n" href="#Tools%20Menu">Tools Menu</a>,
621
Previous:&nbsp;<a rel="previous" accesskey="p" href="#File%20Menu">File Menu</a>,
622
Up:&nbsp;<a rel="up" accesskey="u" href="#The%20Menus">The Menus</a>
623
<br>
624
</div>
625
 
626
<h3 class="subsection">Tools Menu</h4>
627
 
628
<p>Apart for standard functionalities, the only relevant item in this menu is the <em>Edito Object</em> which is an interface to
629
the  <small>R</small> <code>edit</code> function.
630
 
631
<div class="node">
632
<p><hr>
633
Node:&nbsp;<a name="Tools%20Menu">Tools Menu</a>,
634
Next:&nbsp;<a rel="next" accesskey="n" href="#Workspace%20Menu">Workspace Menu</a>,
635
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Edit%20Menu">Edit Menu</a>,
636
Up:&nbsp;<a rel="up" accesskey="u" href="#The%20Menus">The Menus</a>
637
<br>
638
</div>
639
 
640
<h3 class="subsection">Tools Menu</h4>
641
 
642
<p>With this menu you can load and save the history of commands typed in the <small>R</small> Console or view what's currently inside. 
643
You can also change the current working directory, let <small>R</small> show you the current working directory or set it back to the
644
startup directory. From release 1.9.0 of <small>R</small> the current working directory is also shown on the main window bar.
645
 
646
<div class="node">
647
<p><hr>
648
Node:&nbsp;<a name="Workspace%20Menu">Workspace Menu</a>,
649
Next:&nbsp;<a rel="next" accesskey="n" href="#Packages%20Menu">Packages Menu</a>,
650
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Tools%20Menu">Tools Menu</a>,
651
Up:&nbsp;<a rel="up" accesskey="u" href="#The%20Menus">The Menus</a>
652
<br>
653
</div>
654
 
655
<h3 class="subsection">Workspace Menu</h4>
656
 
657
<p>Here you find self explanatory menu items for manage your workspace in <small>R</small>. You can either load and save the workspace also
658
by specifying file name. All of these are interfaces to the <code>load</code> and <code>save</code> <small>R</small> commands. 
659
The only relevant item, which is specific to this GUI, is the <em>Browse workspace</em>. This will open a window with a summary
660
description of the objects in your workspace. Complex objects (like lists, data.frame etc) can be expanded (one level only though).
661
 
662
<div class="node">
663
<p><hr>
664
Node:&nbsp;<a name="Packages%20Menu">Packages Menu</a>,
665
Next:&nbsp;<a rel="next" accesskey="n" href="#The%20Help%20Menu">The Help Menu</a>,
666
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Workspace%20Menu">Workspace Menu</a>,
667
Up:&nbsp;<a rel="up" accesskey="u" href="#The%20Menus">The Menus</a>
668
<br>
669
</div>
670
 
671
<h3 class="subsection">Packages Menu</h4>
672
 
673
<p>Using this menu you can have access to the list of packages and data-sets installed on your system and to the ones
674
on <small>CRAN</small> or on the Bioconductor site.
675
 
676
   <p>With the first two menus you can load and detach packages and data-set from the workspace. 
677
Let's start with the <em>Package Manager</em>. This opens a window with several columns displayed. 
678
For each package on your system you can see a check box, the current status of the package (loaded/not loaded), its name
679
and the package description text. You use the check box to select/de-select the packages you want. 
680
On window closure, the checked packaged will be loaded and the unchecked ones (if loaded) will the detached (not completely as on Mac OS X you cannot
681
unload completely dynamic libraries).
682
 
683
   <p>The same applies to the <em>Dataset Manager</em> menu but for data-sets.
684
 
685
   <p>You can than get or update packages <small>CRAN</small> either in binary or source format. Daily build of <small>CRAN</small> packages are available
686
for Mac OS X. If you don't know how to build <small>R</small> itself from source (see <a href="#Building%20R%20from%20sources">Building R from sources</a>),
687
you'll probably be unable to build packages from source on your own. 
688
In this case, you should always choose for the binary option. These binary packages work (for sure!) for the release version of <small>R</small> for Mac OS X
689
you find on <small>CRAN</small> even though it is not excluded that they will work for other prebuilt versions of <small>R</small>.
690
 
691
   <p>When you attempt to install packages from <small>CRAN</small>, <small>R</small> first tries to get a connection to the Internet to download
692
the list of available packages. Than a window will open similar to the one in the package manager with the only difference that
693
for each package there is also the information concerning the version of the package installed on your system (if any) and
694
the version of the prebuilt package available on <small>CRAN</small>. When you close the window, the select packages will be downloaded.
695
 
696
   <p>The same strategy applies to the Bioconductor menu item, with some more options typical of the Bioconductor way
697
of managing packages.
698
 
699
   <p>For some reason it could happen that you have the package you want to install (either in binary or source form) on one of your
700
local disks, or even a directory containing a package source. You can use the last menu to do the task of installing the package. 
701
Having a package in a directory form usually applies to people that are developing packages themselves.
702
 
703
   <p>For more information on this topic see also <a href="#How%20to%20install%20packages">How to install packages</a>.
704
 
705
<div class="node">
706
<p><hr>
707
Node:&nbsp;<a name="The%20Help%20Menu">The Help Menu</a>,
708
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Packages%20Menu">Packages Menu</a>,
709
Up:&nbsp;<a rel="up" accesskey="u" href="#The%20Menus">The Menus</a>
710
<br>
711
</div>
712
 
713
<h3 class="subsection">The Help Menu</h4>
714
 
715
<p>Using this menu you can open the on-line manuals (<em>R Help</em>), read this FAQ and  review the latest changes, bug fixes and new features of R for Mac OS X (<em>What's new in this version</em>). 
716
There are also interfaces to the R <em>help</em> and <em>help.search</em> functions as well as the <em>example</em> function.
717
 
718
<div class="node">
719
<p><hr>
720
Node:&nbsp;<a name="Preferences">Preferences</a>,
721
Next:&nbsp;<a rel="next" accesskey="n" href="#The%20near%20future%20of%20the%20Aqua%20GUI">The near future of the Aqua GUI</a>,
722
Previous:&nbsp;<a rel="previous" accesskey="p" href="#The%20Menus">The Menus</a>,
723
Up:&nbsp;<a rel="up" accesskey="u" href="#R%20with%20Aqua%20GUI">R with Aqua GUI</a>
724
<br>
725
</div>
726
 
727
<h3 class="section">Preferences</h3>
728
 
729
<p>You can set several aspects of the <small>R</small> GUI via preferences. You can access the Preferences window via the Application menu when the
730
<small>R</small> Console is open. 
731
Preferences are organized in Tabs, more or less grouped for content.
732
 
733
<ul class="menu">
734
<li><a accesskey="1" href="#Text%20Windows%20tab">Text Windows tab</a>: 
735
<li><a accesskey="2" href="#Quartz%20device%20tab">Quartz device tab</a>: 
736
<li><a accesskey="3" href="#Packages%20tab">Packages tab</a>: 
737
<li><a accesskey="4" href="#Misc%20tab">Misc tab</a>: 
738
</ul>
739
 
740
<div class="node">
741
<p><hr>
742
Node:&nbsp;<a name="Text%20Windows%20tab">Text Windows tab</a>,
743
Next:&nbsp;<a rel="next" accesskey="n" href="#Quartz%20device%20tab">Quartz device tab</a>,
744
Up:&nbsp;<a rel="up" accesskey="u" href="#Preferences">Preferences</a>
745
<br>
746
</div>
747
 
748
<h3 class="subsection">Text Windows tab</h4>
749
 
750
<p>You can change the font size, face and the tab size in all the windows including the Console. 
751
If you have help windows opened, the changed only apply to the Console window and to the window
752
you'll open from now on. This is a misfeature more than a bug.
753
 
754
   <p>You can also change the foreground and background colors for the read-only windows (i.e. the <small>R</small> Console
755
output and the Help windows) and for read-and-write windows (i.e. the <small>R</small> Console input and the Edit windows). 
756
At the moment you cannot change the color of the cursor which always stays black which ever  background you choose. 
757
So, for the time being, it's a bad idea to set the background of the <small>R</small> Console to black.
758
 
759
   <p>You have also the possibility to check two options. The first is for adapting the <small>R</small> output when you resize the
760
<small>R</small> Console to the maximum character displayable, the second one is to let <small>R</small> remember the position of the
761
<small>R</small> Console on exit.
762
 
763
<div class="node">
764
<p><hr>
765
Node:&nbsp;<a name="Quartz%20device%20tab">Quartz device tab</a>,
766
Next:&nbsp;<a rel="next" accesskey="n" href="#Packages%20tab">Packages tab</a>,
767
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Text%20Windows%20tab">Text Windows tab</a>,
768
Up:&nbsp;<a rel="up" accesskey="u" href="#Preferences">Preferences</a>
769
<br>
770
</div>
771
 
772
<h3 class="subsection">Quartz device tab</h4>
773
 
774
<p>You can set all the parameters of the <code>quartz</code> device for this tab. Please note: your changes only take effect
775
if you select the final checkbox, namely <em>override the R quartz default settings</em>.
776
 
777
   <p>This also apply to the <em>Quartz window position</em> option even if it is not a <code>quartz</code> parameter itself.
778
 
779
<div class="node">
780
<p><hr>
781
Node:&nbsp;<a name="Packages%20tab">Packages tab</a>,
782
Next:&nbsp;<a rel="next" accesskey="n" href="#Misc%20tab">Misc tab</a>,
783
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Quartz%20device%20tab">Quartz device tab</a>,
784
Up:&nbsp;<a rel="up" accesskey="u" href="#Preferences">Preferences</a>
785
<br>
786
</div>
787
 
788
<h3 class="subsection">Packages tab</h4>
789
 
790
<p>From this tab you can set the default repositories for the <small>CRAN</small> and Bioconductor urls. This will affect the
791
corresponding <small>R</small> <code>options</code>.
792
 
793
<div class="node">
794
<p><hr>
795
Node:&nbsp;<a name="Misc%20tab">Misc tab</a>,
796
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Packages%20tab">Packages tab</a>,
797
Up:&nbsp;<a rel="up" accesskey="u" href="#Preferences">Preferences</a>
798
<br>
799
</div>
800
 
801
<h3 class="subsection">Misc tab</h4>
802
 
803
<p>For this tab you can decide to redirect the stderr and stdout of <small>R</small> and the tasks launched by <small>R</small>, to the <small>R</small> Console. 
804
This is useful, for example, during package installation. If you don't check these options, every output will be sent to the <em>Console</em>
805
application which you can find on every Mac OS X installation inside the directory <code>/Applications/Utilities</code>.
806
 
807
   <p>You can also set the startup working directory. This is very useful for having different sessions in different
808
directories (see <a href="#The%20current%20and%20startup%20working%20directories">The current and startup working directories</a> and <a href="#How%20can%20I%20have%20a%20per%20session%20.Rprofile%3f">How can I have a per session .Rprofile?</a>).
809
 
810
<div class="node">
811
<p><hr>
812
Node:&nbsp;<a name="The%20near%20future%20of%20the%20Aqua%20GUI">The near future of the Aqua GUI</a>,
813
Next:&nbsp;<a rel="next" accesskey="n" href="#Aqua%20GUI%20Bugs">Aqua GUI Bugs</a>,
814
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Preferences">Preferences</a>,
815
Up:&nbsp;<a rel="up" accesskey="u" href="#R%20with%20Aqua%20GUI">R with Aqua GUI</a>
816
<br>
817
</div>
818
 
819
<h3 class="section">The near future of the Aqua GUI</h3>
820
 
821
<p>Jointly with Simon Urbanek we are currently working to replace the current Aqua GUI, which is Carbon-based,
822
with a pure Cocoa GUI. This will allow for a better integration of R with Mac OS X and
823
a fully Aqua-compliant GUI. 
824
A preview of the Cocoa GUI for Darwin R can be obtained after the official
825
release of R 1.9.0 is out from <a href="http://www.economia.unimi.it/R">http://www.economia.unimi.it/R</a>.
826
 
827
<div class="node">
828
<p><hr>
829
Node:&nbsp;<a name="Aqua%20GUI%20Bugs">Aqua GUI Bugs</a>,
830
Previous:&nbsp;<a rel="previous" accesskey="p" href="#The%20near%20future%20of%20the%20Aqua%20GUI">The near future of the Aqua GUI</a>,
831
Up:&nbsp;<a rel="up" accesskey="u" href="#R%20with%20Aqua%20GUI">R with Aqua GUI</a>
832
<br>
833
</div>
834
 
835
<h3 class="section">Aqua GUI Bugs</h3>
836
 
837
<p>On Unix systems a bug report can be generated using the function
838
<code>bug.report()</code>.  This automatically includes the version
839
information and sends the bug to the correct address.  Alternatively the
840
bug report can be emailed to <a href="mailto:R-bugs@R-project.org">R-bugs@R-project.org</a> or submitted
841
to the Web page at <a href="http://bugs.R-project.org/">http://bugs.R-project.org/</a>.
842
 
843
   <p>You can also send specific Aqua GUI bugs directly to <a href="mailto:stefano.iacus@unimi.it">stefano.iacus@unimi.it</a>
844
 
845
   <p>In any circumstances, in case of a crash, please report the
846
crash.log for the <em>R.bin</em> application. You can get this
847
crash.log using the <em>Console.app</em> located inside <em>/Applications/Utilities</em>.
848
 
849
<div class="node">
850
<p><hr>
851
Node:&nbsp;<a name="How%20to%20install%20packages">How to install packages</a>,
852
Next:&nbsp;<a rel="next" accesskey="n" href="#R%20and%20external%20applications">R and external applications</a>,
853
Previous:&nbsp;<a rel="previous" accesskey="p" href="#R%20with%20Aqua%20GUI">R with Aqua GUI</a>,
854
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
855
<br>
856
</div>
857
 
858
<h2 class="chapter">How to install packages</h2>
859
 
860
<p>You have several options for installing new packages on your system. We discuss here only the interface to the standard
861
<small>R</small> functions like <code>install.package</code>. For the <small>R</small> functions see the standard <small>R</small> documentation.
862
 
863
<ul class="menu">
864
<li><a accesskey="1" href="#Which%20kind%20of%20packages%20can%20I%20install%20using%20the%20GUI%3f">Which kind of packages can I install using the GUI?</a>: 
865
<li><a accesskey="2" href="#Installation%20of%20packages%20from%20source">Installation of packages from source</a>: 
866
<li><a accesskey="3" href="#Installation%20of%20pre-built%20binary%20packages">Installation of pre-built binary packages</a>: 
867
<li><a accesskey="4" href="#Can%20I%20install%20packages%20built%20for%20other%20platforms%3f">Can I install packages built for other platforms?</a>: 
868
<li><a accesskey="5" href="#Where%20are%20the%20packages%20I've%20installed%3f">Where are the packages I've installed?</a>: 
869
</ul>
870
 
871
<div class="node">
872
<p><hr>
873
Node:&nbsp;<a name="Which%20kind%20of%20packages%20can%20I%20install%20using%20the%20GUI%3f">Which kind of packages can I install using the GUI?</a>,
874
Next:&nbsp;<a rel="next" accesskey="n" href="#Installation%20of%20packages%20from%20source">Installation of packages from source</a>,
875
Up:&nbsp;<a rel="up" accesskey="u" href="#How%20to%20install%20packages">How to install packages</a>
876
<br>
877
</div>
878
 
879
<h3 class="section">Which kind of packages can I install using the GUI?</h3>
880
 
881
<p>At the moment the GUI menus only provide direct access/download/installation of packages located on <small>CRAN</small> or in the
882
Bioconductor repository. You can also install packages from local files, either binary of source packages, as explained
883
below. Otherwise you can use the appropriate <small>R</small> commands to install packages from a specific location other than the above mentioned ones.
884
 
885
<div class="node">
886
<p><hr>
887
Node:&nbsp;<a name="Installation%20of%20packages%20from%20source">Installation of packages from source</a>,
888
Next:&nbsp;<a rel="next" accesskey="n" href="#Installation%20of%20pre-built%20binary%20packages">Installation of pre-built binary packages</a>,
889
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Which%20kind%20of%20packages%20can%20I%20install%20using%20the%20GUI%3f">Which kind of packages can I install using the GUI?</a>,
890
Up:&nbsp;<a rel="up" accesskey="u" href="#How%20to%20install%20packages">How to install packages</a>
891
<br>
892
</div>
893
 
894
<h3 class="section">Installation of packages from source</h3>
895
 
896
<p>You can choose to install packages from source if they are located on <small>CRAN</small>, on the BioConductor repository and
897
on your local disk. In any case, in order to be able to build packages from source, you need to have the same working
898
setup for building <small>R</small> itself (see <a href="#Building%20R%20from%20sources">Building R from sources</a>). In same cases you can still build packages without all
899
the tools installed, but surely not for all the packages containing C/C++ or Fortran source code.
900
 
901
<p>If you decide to install packages from <small>CRAN</small> you should use the <em>Packages</em> menu of the GUI. In particular the sub-item <em>Get CRAN packages.../Source</em>. 
902
This will connect to <small>CRAN</small> through the Internet and a list of available packages will be shown. 
903
This is list tells you if a package is already installed on your system, the version of the package available on <small>CRAN</small> and the version
904
of the same package if already installed. 
905
You can make multiple selection of packages you intend to install using the checkboxes (one per package). 
906
When you close this window, you'll be asked if you really want to download the selected packages and the process of installation
907
begins. If you don't select any package, nothing happens. 
908
<small>R</small> will not respond on the Console until you  close this window. 
909
The same applies for packages in the BioConductor repository. You have also several other options specific to the
910
BioConductor way of managing repositories of packages.
911
 
912
<p>You can also download any other package from the Internet yourself and decide to install it from source. 
913
You have to use <em>Packages/-&gt;Install form local file</em> submenus. Where you can choose a standard <code>package.tar.gz</code>
914
tarball or the directory containing your package if you have the package in expanded form.
915
 
916
<div class="node">
917
<p><hr>
918
Node:&nbsp;<a name="Installation%20of%20pre-built%20binary%20packages">Installation of pre-built binary packages</a>,
919
Next:&nbsp;<a rel="next" accesskey="n" href="#Can%20I%20install%20packages%20built%20for%20other%20platforms%3f">Can I install packages built for other platforms?</a>,
920
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Installation%20of%20packages%20from%20source">Installation of packages from source</a>,
921
Up:&nbsp;<a rel="up" accesskey="u" href="#How%20to%20install%20packages">How to install packages</a>
922
<br>
923
</div>
924
 
925
<h3 class="section">Installation of pre-built binary packages</h3>
926
 
927
<p>Same considerations of above apply with two minor differences. The first one is that se only distribute pre-built
928
version of packages which pass all the test/checks on Mac OS X. So you'll see that some of the packages are missing with respect to the huge list
929
of source packages available on <small>CRAN</small>.
930
 
931
<p>The second difference is that, when you install packages from local file, it is assumed that the binary package is named
932
as <code>package.tgz</code>. This is to distinguish among source and binary archives.
933
 
934
<div class="node">
935
<p><hr>
936
Node:&nbsp;<a name="Can%20I%20install%20packages%20built%20for%20other%20platforms%3f">Can I install packages built for other platforms?</a>,
937
Next:&nbsp;<a rel="next" accesskey="n" href="#Where%20are%20the%20packages%20I've%20installed%3f">Where are the packages I've installed?</a>,
938
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Installation%20of%20pre-built%20binary%20packages">Installation of pre-built binary packages</a>,
939
Up:&nbsp;<a rel="up" accesskey="u" href="#How%20to%20install%20packages">How to install packages</a>
940
<br>
941
</div>
942
 
943
<h3 class="section">Can I install packages built for other platforms?</h3>
944
 
945
<p>As a general rule the answer is <em>yes</em> if the package does not contain any C/C++/Fortran code in the sources, otherwise
946
the answer is negative. Another caution should be taken, that is, the package and the installed version of <small>R</small> should be
947
the same major release, i.e. you can install a package built for <small>R</small> 1.8.0 on <small>R</small> 1.8.1, but usually not the same
948
package on <small>R</small> 1.9.0.
949
 
950
<p>A Mac OS X specific requirements, is that a prebuilt package is assumed to be named (and accordingly archived and
951
compressed) as <code>package_name.tgz</code>. 
952
On Windows, for example, packages come in a zipped format.
953
 
954
<div class="node">
955
<p><hr>
956
Node:&nbsp;<a name="Where%20are%20the%20packages%20I've%20installed%3f">Where are the packages I've installed?</a>,
957
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Can%20I%20install%20packages%20built%20for%20other%20platforms%3f">Can I install packages built for other platforms?</a>,
958
Up:&nbsp;<a rel="up" accesskey="u" href="#How%20to%20install%20packages">How to install packages</a>
959
<br>
960
</div>
961
 
962
<h3 class="section">Where are the packages I've installed?</h3>
963
 
964
<p>The main library of packages is the one located inside the R.framework. This library contains the packages (base and
965
recommended ones) distributed along with <small>R</small>. At the moment you cannot use the GUI Console to install packages
966
in this location because of authentication problems, you can surely do this from the command line with an admin
967
password, with something like
968
<pre class="example">     sudo R CMD INSTALL pkg_ver.tar.gz
969
     </pre>
970
 
971
<p>By default, the user of <code>R.app</code> installs packages inside the <code>Library/R/library</code> directory
972
in his home directory, i.e. <code>~/Library/R/library</code>. 
973
If you install a package using the <code>R.app</code> interfaces and you then use <small>R</small> from the command line,
974
you won't see or have access to these packages unless you add the <code>~/Library/R/library</code> to the
975
list of libraries locations. You can do the following from inside <small>R</small>
976
<pre class="example">     .libPaths("~/Library/R/library")
977
     </pre>
978
   or write this command in the <code>.Rprofile</code> file in your startup directory. 
979
On some version of OS X the <code>~</code> symbol is not correctly expanded. You should preferably use this
980
version of the above command
981
<pre class="example">     .libPaths(path.expand("~/Library/R/library"))
982
     </pre>
983
 
984
<p>If you have a version of <code>RAqua.app</code> installed on your system, it is likely that you have all the
985
packages installed in <code>~/Library/RAqua/library</code>. You can add this library of packages in the <code>.libPaths()</code>
986
but most of them will probably not work as they were built for release 1.8.x of <small>R</small>.
987
 
988
<div class="node">
989
<p><hr>
990
Node:&nbsp;<a name="R%20and%20external%20applications">R and external applications</a>,
991
Next:&nbsp;<a rel="next" accesskey="n" href="#Quartz%20device">Quartz device</a>,
992
Previous:&nbsp;<a rel="previous" accesskey="p" href="#How%20to%20install%20packages">How to install packages</a>,
993
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
994
<br>
995
</div>
996
 
997
<h2 class="chapter">R and external applications</h2>
998
 
999
<ul class="menu">
1000
<li><a accesskey="1" href="#AppleScript%20support">AppleScript support</a>: 
1001
<li><a accesskey="2" href="#External%20editors">External editors</a>: 
1002
<li><a accesskey="3" href="#Finder%20actions">Finder actions</a>: 
1003
</ul>
1004
 
1005
<div class="node">
1006
<p><hr>
1007
Node:&nbsp;<a name="AppleScript%20support">AppleScript support</a>,
1008
Next:&nbsp;<a rel="next" accesskey="n" href="#External%20editors">External editors</a>,
1009
Up:&nbsp;<a rel="up" accesskey="u" href="#R%20and%20external%20applications">R and external applications</a>
1010
<br>
1011
</div>
1012
 
1013
<h3 class="section">AppleScript support</h3>
1014
 
1015
<p><small>R</small> has partial support for Apple-Scripts. 
1016
At the moment R can be invoked and asked to run commands from an AppleScript script. 
1017
What follows is an example of script that interacts with <small>R</small>. It firstly  invokes <small>R</small> and then
1018
sends commands to <small>R</small> with the <code>cmd</code> applescript command.
1019
 
1020
<pre class="example">     set CommandLine to "R.Version()"
1021
     try
1022
     	tell application "R"
1023
     		activate
1024
     		with timeout of 90000 seconds
1025
     			cmd CommandLine
1026
     			cmd "Sys.getenv()"
1027
     			cmd "print(\"HelloWorld!\")"
1028
     		end timeout
1029
     	end tell
1030
     end try
1031
     </pre>
1032
 
1033
<p>In the above, <code>cmd</code> is the (only) applescript command in the <small>R</small> dictionary that is
1034
used to tell <small>R</small> to execute an <small>R</small> command in the R Console. The syntax is
1035
<pre class="example">     cmd &lt;command string&gt;
1036
     </pre>
1037
   where command string have to be in quotes. Actually, the output of the command
1038
is not sent back to the application that is calling <small>R</small> but to the <small>R</small> Console directly.
1039
 
1040
<p>There are some issues. The first is that if <small>R</small> is still not running, it will take a while (depending on
1041
how fast your machine is) to startup. In the meanwhile the script sends commands without waiting and it
1042
could happen that some commands are missed by <small>R</small>, i.e. they arrive before <small>R</small> is ready to
1043
receive applescript commands. The second issue, is that it could be that the applescript calls a bad version
1044
of <small>R</small>. This could happen if you have an old version of <small>R</small> (for example the old Carbon <small>R</small>) installed on your
1045
System.
1046
 
1047
<p>As an example, we report here a small script that asks <small>R</small> to <code>source</code> a file using a file dialog.
1048
<pre class="smallexample">     set file_to_source to (choose file with prompt "Choose file to source") as alias
1049
 
1050
     try
1051
     	tell application "R"
1052
     		activate
1053
     		with timeout of 90000 seconds
1054
     			cmd "source(\"" &amp; file_to_source &amp; "\")"
1055
     		end timeout
1056
     	end tell
1057
     end try
1058
     </pre>
1059
 
1060
<div class="node">
1061
<p><hr>
1062
Node:&nbsp;<a name="External%20editors">External editors</a>,
1063
Next:&nbsp;<a rel="next" accesskey="n" href="#Finder%20actions">Finder actions</a>,
1064
Previous:&nbsp;<a rel="previous" accesskey="p" href="#AppleScript%20support">AppleScript support</a>,
1065
Up:&nbsp;<a rel="up" accesskey="u" href="#R%20and%20external%20applications">R and external applications</a>
1066
<br>
1067
</div>
1068
 
1069
<h3 class="section">External editors</h3>
1070
 
1071
<p><small>R</small> accepts the Apple Event command <em>open</em>. This means than an external editor can communicate with <small>R</small> sending
1072
portions of <small>R</small> code to execute via files. This is the approach used by the <small>R</small>-Tcl Mode in Alpha X
1073
(see <a href="http://www.kelehers.org/alpha/">http://www.kelehers.org/alpha/</a>).
1074
 
1075
<div class="node">
1076
<p><hr>
1077
Node:&nbsp;<a name="Finder%20actions">Finder actions</a>,
1078
Previous:&nbsp;<a rel="previous" accesskey="p" href="#External%20editors">External editors</a>,
1079
Up:&nbsp;<a rel="up" accesskey="u" href="#R%20and%20external%20applications">R and external applications</a>
1080
<br>
1081
</div>
1082
 
1083
<h3 class="section">Finder actions</h3>
1084
 
1085
<p>Dragging a file on the <small>R</small> icon, causes <small>R</small> to source this file via the <code>source</code> <small>R</small> command or,
1086
if the file is an <small>R</small> image data file RDX1 or RDX2 (normally files with extension <code>.rda</code> or <code>.Rdata</code>), the data is loaded in the workspace and every object
1087
with the same name in the workspace is overwritten without notice. Loading a data file is equivalent to
1088
the <small>R</small> command <code>load</code>. 
1089
At the moment there is no control over the file types, i.e. dragging wrong files (i.e. files that are
1090
not <small>R</small> scripts or image data) simply gives an error. It's up to the user to <em>do the right thing</em>.
1091
 
1092
<p>If <small>R</small> is not yet running this action causes <small>R</small> to startup.
1093
 
1094
<div class="node">
1095
<p><hr>
1096
Node:&nbsp;<a name="Quartz%20device">Quartz device</a>,
1097
Next:&nbsp;<a rel="next" accesskey="n" href="#TclTk%20issues">TclTk issues</a>,
1098
Previous:&nbsp;<a rel="previous" accesskey="p" href="#R%20and%20external%20applications">R and external applications</a>,
1099
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1100
<br>
1101
</div>
1102
 
1103
<h2 class="chapter">Quartz device</h2>
1104
 
1105
<p>The quartz device is the native graphic device in R for Mac OS X. It's name derives from Apple's Quartz Technology
1106
which is essentially similar to PDF rendering. One of the most amazing features of Quartz is antialiasing which gives you
1107
<em>very nice</em> plots and images. Try to compare  a quartz plot  with the same plot generated on
1108
any other interactive device. For its PDF nature it is also resolution independent.
1109
 
1110
<ul class="menu">
1111
<li><a accesskey="1" href="#Interactive%20mode">Interactive mode</a>: 
1112
<li><a accesskey="2" href="#Saving%20the%20image">Saving the image</a>: 
1113
<li><a accesskey="3" href="#Copying%20the%20image%20into%20the%20clipboard">Copying the image into the clipboard</a>: 
1114
<li><a accesskey="4" href="#Known%20bugs%20and%20missing%20features">Known bugs and missing features</a>: 
1115
</ul>
1116
 
1117
<div class="node">
1118
<p><hr>
1119
Node:&nbsp;<a name="Interactive%20mode">Interactive mode</a>,
1120
Next:&nbsp;<a rel="next" accesskey="n" href="#Saving%20the%20image">Saving the image</a>,
1121
Up:&nbsp;<a rel="up" accesskey="u" href="#Quartz%20device">Quartz device</a>
1122
<br>
1123
</div>
1124
 
1125
<h3 class="section">Interactive mode</h3>
1126
 
1127
<p>The quartz device allows for interaction. You can use both <code>identify</code> and <code>locator</code> functions. 
1128
To break the sequence you should press the ESC key on your keyboard as Apple's mouse have ever had only one
1129
button.
1130
 
1131
<div class="node">
1132
<p><hr>
1133
Node:&nbsp;<a name="Saving%20the%20image">Saving the image</a>,
1134
Next:&nbsp;<a rel="next" accesskey="n" href="#Copying%20the%20image%20into%20the%20clipboard">Copying the image into the clipboard</a>,
1135
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Interactive%20mode">Interactive mode</a>,
1136
Up:&nbsp;<a rel="up" accesskey="u" href="#Quartz%20device">Quartz device</a>
1137
<br>
1138
</div>
1139
 
1140
<h3 class="section">Saving the image</h3>
1141
 
1142
<p>You can can the content of the quartz device window into a PDF file. This is a very simple way to
1143
export high quality graphics from <small>R</small> into other applications on Mac OS X graphics is PDF based (so are almost all
1144
applications available). If you want bitmap copies of you quartz device window just use copy, to copy the image into the clipboard and
1145
paste the result in a graphic application (see <a href="#Copying%20the%20image%20into%20the%20clipboard">Copying the image into the clipboard</a>).
1146
 
1147
<div class="node">
1148
<p><hr>
1149
Node:&nbsp;<a name="Copying%20the%20image%20into%20the%20clipboard">Copying the image into the clipboard</a>,
1150
Next:&nbsp;<a rel="next" accesskey="n" href="#Known%20bugs%20and%20missing%20features">Known bugs and missing features</a>,
1151
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Saving%20the%20image">Saving the image</a>,
1152
Up:&nbsp;<a rel="up" accesskey="u" href="#Quartz%20device">Quartz device</a>
1153
<br>
1154
</div>
1155
 
1156
<h3 class="section">Copying the image into the clipboard</h3>
1157
 
1158
<p>You can copy the content of the quartz device window in the clipboard to make the resulting image available for
1159
pasting into other applications. The clipboard will contain a bitmap copy of the quartz device window. If you
1160
want to work with high resolution images, you should save the content of the quartz device as a PDF file (see <a href="#Saving%20the%20image">Saving the image</a>). 
1161
Pay attention to the following fact: the bitmap image produced has exactly the same dimensions of the quartz device window. This
1162
means that if you resize the window, the resulting image you obtain in the clipboard will have the same
1163
dimensions and you cannot resize the image from the inside another applications (say MS-Word) without loosing quality.
1164
 
1165
<div class="node">
1166
<p><hr>
1167
Node:&nbsp;<a name="Known%20bugs%20and%20missing%20features">Known bugs and missing features</a>,
1168
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Copying%20the%20image%20into%20the%20clipboard">Copying the image into the clipboard</a>,
1169
Up:&nbsp;<a rel="up" accesskey="u" href="#Quartz%20device">Quartz device</a>
1170
<br>
1171
</div>
1172
 
1173
<h3 class="section">Known bugs and missing features</h3>
1174
 
1175
<p>When rendering text and/or mathematical symbols the style is ignored, i.e. only plain style is drawn. 
1176
The printing function is not yet implemented.
1177
 
1178
<div class="node">
1179
<p><hr>
1180
Node:&nbsp;<a name="TclTk%20issues">TclTk issues</a>,
1181
Next:&nbsp;<a rel="next" accesskey="n" href="#Additional%20resources">Additional resources</a>,
1182
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Quartz%20device">Quartz device</a>,
1183
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1184
<br>
1185
</div>
1186
 
1187
<h2 class="chapter">TclTk issues</h2>
1188
 
1189
<p>Each binary distribution of <small>R</small> available through <small>CRAN</small> is built to use the X11 implementation of TclTk. 
1190
Of course a X windows server has to be started first. If you are not using the Aqua GUI you need to also
1191
define the environment variable DISPLAY before attempting to use X11 from inside <small>R</small>. You can do this as follows
1192
<pre class="example">     Sys.putenv("DISPLAY"=":0")
1193
     </pre>
1194
   If you don't like the X11 GUI you would probably want to build R using the Aqua version of TclTk (see <a href="#the%20Aqua%20TclTk%20headers%20and%20libraries%20(optional)">the Aqua TclTk headers and libraries (optional)</a>). 
1195
After installing the R.framework you should do the following to have the quartz device working under Aqua TclTk. Open a
1196
Terminal window and move inside the <code>Resources/bin</code> directory of the <code>R.framework</code>
1197
(usually <code>/Library/Frameworks/R.framework</code>), then type the following
1198
<pre class="example">     sudo /Developer/Tools/Rez -t APPL Carbon.r -o R.bin
1199
     </pre>
1200
 
1201
<div class="node">
1202
<p><hr>
1203
Node:&nbsp;<a name="Additional%20resources">Additional resources</a>,
1204
Next:&nbsp;<a rel="next" accesskey="n" href="#Acknowledgments">Acknowledgments</a>,
1205
Previous:&nbsp;<a rel="previous" accesskey="p" href="#TclTk%20issues">TclTk issues</a>,
1206
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1207
<br>
1208
</div>
1209
 
1210
<h2 class="chapter">Additional resources</h2>
1211
 
1212
<p>Here are few references that can be of interest for Mac OS X and/or developers.
1213
 
1214
<ul class="menu">
1215
<li><a accesskey="1" href="#Apple%20Developer%20Connection">Apple Developer Connection</a>: 
1216
<li><a accesskey="2" href="#The%20R%20for%20Mac%20OS%20X%20Developer%20page">The R for Mac OS X Developer page</a>: 
1217
</ul>
1218
 
1219
<div class="node">
1220
<p><hr>
1221
Node:&nbsp;<a name="Apple%20Developer%20Connection">Apple Developer Connection</a>,
1222
Next:&nbsp;<a rel="next" accesskey="n" href="#The%20R%20for%20Mac%20OS%20X%20Developer%20page">The R for Mac OS X Developer page</a>,
1223
Up:&nbsp;<a rel="up" accesskey="u" href="#Additional%20resources">Additional resources</a>
1224
<br>
1225
</div>
1226
 
1227
<h3 class="section">Apple Developer Connection</h3>
1228
 
1229
<p>The Apple Developer Connection (can be reached at <a href="http://developer.apple.com">http://developer.apple.com</a>) is the main source
1230
of information for Apple products (OS, hardware, software) for developers. You can subscribe for free to
1231
ADC and get the latest up-to-date tools from Apple (compilers for example).
1232
 
1233
<div class="node">
1234
<p><hr>
1235
Node:&nbsp;<a name="The%20R%20for%20Mac%20OS%20X%20Developer%20page">The R for Mac OS X Developer page</a>,
1236
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Apple%20Developer%20Connection">Apple Developer Connection</a>,
1237
Up:&nbsp;<a rel="up" accesskey="u" href="#Additional%20resources">Additional resources</a>
1238
<br>
1239
</div>
1240
 
1241
<h3 class="section">The R for Mac OS X Developer page</h3>
1242
 
1243
<p>There is a page dedicated to the latest R-devel version of R. This page is located at
1244
<a href="http://www.economia.unimi.it/R">http://www.economia.unimi.it/R</a> and is maintained by Stefano M. Iacus. 
1245
This page is intended to give additional documentation for building  the latest R-devel
1246
version of R. From time to time, snapshots of R-devel binaries are available for testing purposes.
1247
 
1248
<div class="node">
1249
<p><hr>
1250
Node:&nbsp;<a name="Acknowledgments">Acknowledgments</a>,
1251
Next:&nbsp;<a rel="next" accesskey="n" href="#Sparse%20questions">Sparse questions</a>,
1252
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Additional%20resources">Additional resources</a>,
1253
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1254
<br>
1255
</div>
1256
 
1257
<h2 class="chapter">Acknowledgments</h2>
1258
 
1259
<p>Special thanks go to Simon Urbanek, Jan de Leeuw, Byron Ellis and Thomas Lumley
1260
in random order. Last but not least Apple for amazing OS and GUI.
1261
 
1262
<div class="node">
1263
<p><hr>
1264
Node:&nbsp;<a name="Sparse%20questions">Sparse questions</a>,
1265
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Acknowledgments">Acknowledgments</a>,
1266
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
1267
<br>
1268
</div>
1269
 
1270
<h2 class="chapter">Sparse questions</h2>
1271
 
1272
<ul class="menu">
1273
<li><a accesskey="1" href="#How%20can%20I%20have%20a%20per%20session%20.Rprofile%3f">How can I have a per session .Rprofile?</a>: 
1274
<li><a accesskey="2" href="#What%20happens%20if%20I%20drag%20a%20file%20on%20the%20R%20icon%3f">What happens if I drag a file on the R icon?</a>: 
1275
<li><a accesskey="3" href="#How%20can%20I%20interrupt%20lengthy%20operations%20or%20output%3f">How can I interrupt lengthy operations or output?</a>: 
1276
<li><a accesskey="4" href="#I%20don't%20see%20a%20thing%20when%20installing%20packages!">I don't see a thing when installing packages!</a>: 
1277
</ul>
1278
 
1279
<div class="node">
1280
<p><hr>
1281
Node:&nbsp;<a name="How%20can%20I%20have%20a%20per%20session%20.Rprofile%3f">How can I have a per session .Rprofile?</a>,
1282
Next:&nbsp;<a rel="next" accesskey="n" href="#What%20happens%20if%20I%20drag%20a%20file%20on%20the%20R%20icon%3f">What happens if I drag a file on the R icon?</a>,
1283
Up:&nbsp;<a rel="up" accesskey="u" href="#Sparse%20questions">Sparse questions</a>
1284
<br>
1285
</div>
1286
 
1287
<h3 class="section">How can I have a per session .Rprofile?</h3>
1288
 
1289
<p>You can by writing a <code>.Rprofile</code> file in your favorite
1290
session directory and change accordingly the startup working directory using the Preferences (see <a href="#The%20current%20and%20startup%20working%20directories">The current and startup working directories</a>).
1291
 
1292
<div class="node">
1293
<p><hr>
1294
Node:&nbsp;<a name="What%20happens%20if%20I%20drag%20a%20file%20on%20the%20R%20icon%3f">What happens if I drag a file on the R icon?</a>,
1295
Next:&nbsp;<a rel="next" accesskey="n" href="#How%20can%20I%20interrupt%20lengthy%20operations%20or%20output%3f">How can I interrupt lengthy operations or output?</a>,
1296
Previous:&nbsp;<a rel="previous" accesskey="p" href="#How%20can%20I%20have%20a%20per%20session%20.Rprofile%3f">How can I have a per session .Rprofile?</a>,
1297
Up:&nbsp;<a rel="up" accesskey="u" href="#Sparse%20questions">Sparse questions</a>
1298
<br>
1299
</div>
1300
 
1301
<h3 class="section">What happens if I drag a file on the R icon?</h3>
1302
 
1303
<p>In this case <small>R</small> will try to source this file or load the image data file (see <a href="#Finder%20actions">Finder actions</a>). If <small>R</small> is not
1304
yet running it will be launched.
1305
 
1306
<div class="node">
1307
<p><hr>
1308
Node:&nbsp;<a name="How%20can%20I%20interrupt%20lengthy%20operations%20or%20output%3f">How can I interrupt lengthy operations or output?</a>,
1309
Next:&nbsp;<a rel="next" accesskey="n" href="#I%20don't%20see%20a%20thing%20when%20installing%20packages!">I don't see a thing when installing packages!</a>,
1310
Previous:&nbsp;<a rel="previous" accesskey="p" href="#What%20happens%20if%20I%20drag%20a%20file%20on%20the%20R%20icon%3f">What happens if I drag a file on the R icon?</a>,
1311
Up:&nbsp;<a rel="up" accesskey="u" href="#Sparse%20questions">Sparse questions</a>
1312
<br>
1313
</div>
1314
 
1315
<h3 class="section">How can I interrupt lengthy operations or output?</h3>
1316
 
1317
<p>You can now use the standard Macintosh control break sequence, that is you should press
1318
"Cmd option" and "." (dot). This will interrupt any <small>R</small> loops. The "Esc" key gives you the same result.
1319
 
1320
<div class="node">
1321
<p><hr>
1322
Node:&nbsp;<a name="I%20don't%20see%20a%20thing%20when%20installing%20packages!">I don't see a thing when installing packages!</a>,
1323
Previous:&nbsp;<a rel="previous" accesskey="p" href="#How%20can%20I%20interrupt%20lengthy%20operations%20or%20output%3f">How can I interrupt lengthy operations or output?</a>,
1324
Up:&nbsp;<a rel="up" accesskey="u" href="#Sparse%20questions">Sparse questions</a>
1325
<br>
1326
</div>
1327
 
1328
<h3 class="section">I don't see a thing when installing packages!</h3>
1329
 
1330
<p>Well, this is not a question but the answer is that you are not looking at the right place. 
1331
Every input and output which is not <small>R</small> specific (i.e. the output of standard commands) is generally sent to
1332
the standard output (stdout) or standard error (stderr) depending on its nature. In particular every call to the
1333
<code>system</code> function, executes outside <small>R</small> in a Mac OS X shell. The package installation is done via
1334
the <code>system</code> facility. 
1335
You have to use the Preferences to redirect the stderr and/or the stdout to the <small>R</small> Console (see <a href="#Misc%20tab">Misc tab</a>)
1336
or you can look at the <em>Console</em> application inside <code>/Applications/Utilities</code> on your system. 
1337
This applies to every GUI application on Mac OS X so, as a general rule, if an application behaves strangely or quits,
1338
please have a look to the <em>Console</em> application.
1339
 
1340
   </body></html>
1341