Linguistic Society of America Summer Institute 2007 - Stanford University

R for MacOS X

[UP]

Installing on 10.4.4 or higher

First, if you're running 10.4.0 - 10.4.3 you're going to have to run Software Update to get a more current version of MacOS X. If you're running anything less than 10.4.10 but more than 10.4.3 this step is recommended but not necessary.

To install R for MacOS X, start by going to the R Project homepage. Down the left side of the page there's a column of links. Click on the CRAN link. Select a miror site from the list. On the next page in the "Download and Install R" box, click on the "MacOS X" link, then on the "R-2.5.0.dmg (latest version)" link to download R. Once it has downloaded, double click on the dmg file to start the installer. We're going to take the custom action of installing gfortran, so you probably want to look at the installation page, then head over to the package installation page.

Building R yourself

Not for the faint of heart. Please only try this if you are running MacOS X 10.3 (and thus don't have a precompiled version to download) and are experienced building software.

In order to build R yourself, you need XCode plus a gfortran package that matches your current version of GCC (e.g. 3.4 or 4.0). You can find your gcc version by typing

gcc --version

in a Terminal. It's pretty hard to find gfortran compiled for anything but MacOS X 10.4, although you could try HPC Mac OS X's PPC g77 3.4 and g95 packages from December 2004 if you are using gcc 3.4 on MacOS X 10.3. I've not tried it, so no guarantees.

To compile the documentation, you're going to have to have installed LaTex first.

To compile do the following at the command line of a Terminal:

./configure --with-blas='-framework vecLib' --enable-BLAS-shlib --with-lapack

then if the configuration was successful type

make

then if the build is sucessful type

sudo make install

After everything is installed do the following:

sudo ln -s /Library/Frameworks/R.framework/Resources/R /usr/local/bin/R

To get the R GUI, make sure you have subversion installed and type the following in a Terminal:

svn co https://svn.r-project.org/R-packages/trunk/Mac-GUI

when that is finished cd to the Mac-GUI directory and type

make

In a build subdirectory should be R.app, which you then drag to Applications.