[R-SIG-Mac]Mac OS X version of R

Jan de Leeuw deleeuw@stat.ucla.edu
Fri, 30 Aug 2002 21:50:49 -0700

It seems clear by now that there are (at least) two approaches to  
R for OS X. I think we will see both, at some point.

1. Make a Cocoa application that communicates with R in some way or
another. Jose's version uses pipes, but a nicer alternative is perhaps  
to use
Cocoa distributed processes. The Cocoa application will be written in
Objective C, and will not run on OS 9. It will use ProjectBuilder. We
may need three Cocoa applications, all able to send and receive
messages. The first is the R GUI, the second is the R computing
engine, and the third is the Quartz graphics device. See


This will be a standalone R, not fitting very well in the R-core
build and upgrade strategy, but it will be able to use all the
facilities of Cocoa and Objective C.

This is also the way TeXShop works, providing a Cocoa interface to
an unmodified teTeX (using pipes).

2. Make a OS X GUI for R along the lines of the gnome or windows
GUI's. This just adds a new GUI to R, using R calling conventions.
It uses makefiles, it will probably be written in C, and it will  
tend to use Carbon. This is what Stefano is working on. Obviously this
is faster to build, easier to maintain, and it fits in the R-core build  
update strategy. It will also run on older Macs and OS 9.

3. There are some other options. These examples are well worth studying.

3a. Take Python. It can optionally be build as a
framework, with all of Unix python in it, installed in  
Links to the executables are made in /usr/local/bin. Carbon and
Cocoa applications are put in /Applications/Python (an IDE,
an AppletBuilder and a Launcher) -- these all link to the framework.
I am not sure what form of IPC they use. Anonymous CVS from

configure --enable-framework
(sudo) make frameworkinstall

3b. Take Emacs. You build a regular Emacs, the Lisp files are
installed in /usr/local/share, a Carbon bundle around the
binary Emacs is put in /Applications. Anonymous CVS from

configure --without-x
make bootstrap
make install
cd mac

3c. Take Tcl/Tk. It puts all of Tcl in a framework and all of Tk in
a framework, and then buildsa little application around this
(Wish). This is native (Aqua) Tk.


3.cc You cannot get the source for AlphaTk, which uses the
Tcl/Tk frameworks, and has all the tcl scripts that make up
the editor in its bundle. See


Jan de Leeuw; Professor and Chair, UCLA Department of Statistics;
US mail: 9432 Boelter Hall, Box 951554, Los Angeles, CA 90095-1554
phone (310)-825-9550;  fax (310)-206-5658;  email: deleeuw@stat.ucla.edu
homepage: http://gifi.stat.ucla.edu
           No matter where you go, there you are. --- Buckaroo Banzai