Installing GNU R and the R Commander
(These instructions are a modified and adapted version of a set of instructions originally written by Glen van Brummelen.)
GNU R is a statistical programming language and data processing package. The "R Commander" (or Rcmdr) is a graphical front-end that gives you menu-driven access to a lot of the basic functions you'd want to use within R, saving you from having to build arcane commands from scratch.
R packages and add-ons come from of a series of mirrors called CRAN, for the "Comprehensive R Archive Network".
Windows
Go to the CRAN site at SFU... if you're in British Columbia. If elsewhere, choose an appropriate mirror from the list of CRAN mirrors.
Click on the "Windows" link the "base" link, and then the big "Download R 2.11.1 for Windows" link. That will download a file R-2.11.1-win32.exe (with possibly a newer version number) to your desktop or Downloads folder (or wherever your downloads go).
Run the downloaded executable. When that's done, R itself is installed.
To use R commander, you need to run R in a "single document interface" mode. Honestly, I have no solid clue what that is, as this restriction seems to be a Windows-specific thing. In order to make this happen, right click on the desktop icon you will use to run R and select "Properties". In the Shortcut tab, you'll find a field "Target". After the quotes, add a space and --sdi (with two dashes). The entire field should read something like this:
"C:\Program Files\R\R-2.11.2\bin\Rgui.exe" --sdiTo install the R commander, run R. From the command line, run the following:
install.packages("Rcmdr", dependencies=TRUE)This will install the R commander and its huge set of dependencies. It will take quite a while to run. (10 minutes? Half an hour? Something like that. It will depend on how fast your computer is and how good your Internet connection is.)
From now on, after starting R, you can run the R commander by typing the following command into R:
library(Rcmdr)
MacOS X
Prerequisites
Before you install R and Rcmdr, there are some things you want to have installed on your Mac. If you have Leopard or later, you should automatically have X11 installed. If not... get that installed. You can find it with your install DVD.
Go to the CRAN site at SFU... if you're in British Columbia. If elsewhere, choose an appropriate mirror from the list of CRAN mirrors.
Select the "MacOS X" link.
Scroll down to the "Files" section, and download the main R pkg archive. As of this writing, that is R-2.11.1.pkg.
Install R from this pkg file the way you normally install things from a pkg file. (It's been a couple of years since I used a Mac, so I don't remember the details.)
Also from the "Files" section of the CRAN page, look at the description text to the right of the link to the R pkg file. Towards the bottom, it has a link to a "tools directory". Follow that link.
From this tools page, you need at least to download and install the tcltk-8.5.5-x11.dmg package. I do not believe that you need the gfortran package, but you can install that if things seem not to be working.
Now that you've got all of that installed, run R from whatever icon has been installed to let you run R.
In the R console that opens up, run the following command to install the R commander and needed prerequisites:
install.packages("Rcmdr", dependencies=TRUE)This may take a while (10 minutes? half an hour?) depending on your Internet connection and the speed of your computer.
From now on, when you run R, run X11. Remember to do this before you try to start R commander! Then, inside R, to run R commander, type the following command:
library(Rcmdr)
Tiger
If you're still on Tiger... update to Snow Leopard! If you really won't do that, then you can install GNU R, but not the latest version.
First, you have to install X11. Here are instructions for installing X11 on Tiger without the Install DVD. When you install R, take a look at the archives, and keep going back until you find a version of R that succesfully installs and runs. You may need to go back to R 2.9. I am pretty sure that R 2.11 will not work on Tiger.
Linux
It's almost certainly in your distro. Install it from there. Be sure to gloat over everybody else that you are running R on the OS closest to the native operating system it is intended to be run on. Rcmdr is also probably in your distro. Sadly, in Ubuntu, some of the things Rcmdr wants aren't included. For that reason, you might want to install Rcmdr from inside R rather than through the package system. Or, you could just ignore the warnings when things start, and hope that you aren't affected. If you want to install Rcmdr from inside R, then uninstall any Rcmdr package you've installed, and run the following from R: