In Part I of this Benchmarks
Online article,
we walked through installing R on OS-X Tiger 10.4.3 from
source. While I would hope anyone reading this column would be
at least equally comfortable with working in both a command
line and GUI environment, most computer users do prefer a GUI
interface. Thankfully, R has a new Cocoa-built GUI interface
on OS-X. In Part II of “From the Source” we will build R.app
using XCode tools and get this GUI interface up and running.
Before we begin, there is a bit of clarification that will
help keep what we’re working on in this article delineated
from other R GUIs on OS-X. R.app is the most current GUI for R
on OS-X, but it is not the only GUI project. There is also an
Aqua interface to R and a Cocoa GUI bundle. R.app is written
in Cocoa, but is not a bundle; it’s a whole new Cocoa GUI for
R on OS-X and is current for all versions of R on OS-X after R
2.0.
As before, be
sure to reference the official R for Max OS-X FAQ:
http://cran.r-project.org/bin/macosx/RMacOSX-FAQ.html
.
Building R.app
The hard part of building R for OS-X is,
as previous described, making sure all of the dependencies you
need are present and properly installed. We are reminded of
this once more in building R.app, which relies on a specific
set of configuration flags in the compilation of R 2.2.0 that
I did not mention in the previous article and the most current
version of XCode installed (a version as or more recent than
XCode 1.5 should work).
First, when you issue your ./configure
command to configure and make R 2.2.0 from source, you need to
set the following flags to insure the proper environment for
building R.app as the next step:
- ./configure
–with-blas=’-framework vecLib’ –with-lapack –with-aqua
- make
- sudo
make install
BLAS is a facility for matrix
computations, LAPACK is a facility for numerical linear
algebra, the vecLib framework is a collection of processing
and operations facilities, including BLAS and LAPACK and aqua
is an older flag, a still-necessary holdover from the aqua GUI
days.
After R has been installed with the above flags, the R.app
source can be downloaded in tar ball from the CRAN website
(follow the hyperlink to R for Mac 10.2.x and above). Once
this file has been downloaded, you’ll want to uncompress it
(tar –xvf) and then issue the following command from within
the uncompressed Mac-GUI directory:
xcodebuild
–target R –buildstyle Deployment
R.app in Pictures
Now that we’ve successfully compiled
R.app, let’s look at our creation. In the /Applications file
path, find the R icon and double-click on it. It should launch
something that looks like the following:

So what’s so special about this? It
doesn’t look that different! Well, once we take a timed screen
grab with action (using the package installer from the drop
down menu to download and install R packages), you can begin
to see the usability advantages offered by R.app:

Once correctly compiled, R.app displays
an R Console (I changed the background color preferences to
light green from the default white) and nine GUI drop-down
menus for various aspects of working with R (R, File, Edit,
Format, Workspace, Packages & Data, Misc, Window and Help).
The Disk Image Buzzkill: R-2.2.0
If you’ve read this article and the
preceding article through and would like to bring R-2.2.0 with
the Cocoa GUI up but you’re not comfortable with doing all of
this work from the command line, there is an alternative:
Installing R-2.2.0 from a disk image available from CRAN and
can be done via point and click.
While folks who are new to using command line tools to
configure, compile and/or install would find it easier to
download the disk image file and point and click their way
through the installation, you will not get the same kind of
control over detail from the GUI installation that you will
from the command line. Regardless, it’s worth noting that a
command line alternative does exist.
On a closing note, Rich, Mike and I would like to wish all of
our readers "Happy Holidays" and we
look forward to you visiting us in 2006!