R Commander Installation Notes

The Rcmdr package is a standard R package, and it installs and is loaded in the normal manner. There are, however, a few installation issues, particularly on Macintosh systems, and these are described in this document.

A general point is keep is mind is that the Rcmdr package uses a number of other "contributed" packages (in addition to packages, such as tcltk and MASS, that are part of the standard R distribution), and these must be present for it to work properly: abind, car, effects, lmtest, multcomp, mvtnorm, relimp, sandwich, strucchange, and zoo. In addition, you should install the rgl package if you want dynamic 3D graphics under the R Commander.

Once it is installed, to load the Rcmdr package, just enter the command library(Rcmdr).

Notes for specific platforms follow:

Windows

The easiest way to install the Rcmdr package if you have an active Internet connection, is via the Rgui Packages -> Install packages menu. As of R 2.5.0, however, only the Rcmdr package and not missing packages on which it depends will be downloaded and installed. You can, however, install the Rcmdr package and all of its dependencies from the R command prompt via the command

install.packages("Rcmdr", dependencies=TRUE)

Alternatively, you can load the Rcmdr package after installing it, and it will offer to download and install missing dependencies.  Note: The packages on which the Rcmdr depends also have dependencies, which have dependencies, etc., so many  packages get installed; with a fast Internet connection, the process should go quickly, however. At the time of writing, there is an indirect dependency on one of the Bioconductor packages (Biobase), which will not be installed unless you have selected a Bioconductor package repository; the absence of this package seems to do no harm.

On Windows, the package works properly only with the single-document Rgui interface (SDI). Under the default multiple-document interface (MDI), Tk dialog boxes don't stay on top of the main R window. This is a general issue with applications, such as the R Commander, that are based on the tcltk package.

To enable the SDI, make a copy of the R desktop icon (right-click on the icon, drag it to a different location on the desktop, select Copy Here from the context menu). Right-click the new icon and select Properties. Add --sdi (preceded by a space) to the Target field on the Shortcut tab of the Properties dialog box. The field should read something like "C:\Program Files\R\rw2010\bin\Rgui.exe" --sdi. If you wish, change the name of the icon on the General tab (e.g., to R 2.1.0 SDI). Click OK.

If you wish to load the R Commander automatically when R starts up, you can add the following to the Rprofile.site file in R's etc directory:

local({
old <- getOption("defaultPackages")
options(defaultPackages = c(old, "Rcmdr"))
})

Linux/Unix

Linux/Unix systems typically have all of the software required for building packages already installed. The easiest way to install the Rcmdr package and its dependencies if you have an active Internet connection is to run R as root and issue the command install.packages("Rcmdr", dependencies=TRUE) at the R prompt. 

On Ubutu systems, in particular, the following procedure should work (slightly modified from a suggestion by Ista Zahn):

  1.  Add the R repository to Ubuntu (see http://cran.r-project.org/bin/linux/ubuntu/).
  2.  Install base R and the R dev package: sudo apt-get install r-base r-base-dev
  3. Start R from the Ubuntu command line as root so you can install packages system-wide: sudo R
  4. From the R command prompt, install Rcmdr:  install.packages("Rcmdr", dependencies=TRUE)
It is also possible to install R and R packages from the Ubuntu package respository but these are almost always out of date.

Mac OS X

I am grateful to Rob Goedman (email: goedman AT mac.com), Bill Northcott, and Peter Wickham for contributing these Mac installation notes. Rob has also generously volunteered to help Mac R.app users who encounter problems after carefully reading and trying to apply the procedure explained below.

R Commander, and several other R packages, use the scripting language Tcl and the Tk GUI toolkit combination Tcl/Tk ( for further info, please see http://www.tcl.tk/ ). There are two ways of using Tcl/Tk on Mac OS 10.4.x, using AquaTk or using X11 Tk.
If you are happy running R from the command line and choose to use AquaTk, please refer to the R for Mac OS X FAQ for further help. AquaTk is included in Mac OS X.

The instructions below apply only if you intend to use the X11 version of Tk.This option uses the older X-Windows windowing system instead of Mac OS X's native Aqua to support Tcl/Tk. X11 is either installed on your system or can be installed from the 'optional installs' on your Mac OS X installation DVD (that came with Mac OS X 10.4/Tiger). If you do not have the installation disk for Mac OS X 10.4 readily at hand, the X11 software can be downloaded. Updates can be obtained by checking "Software Update" under System Preferences.  If it is installed, there will be an entry 'X11' in the /Applications/Utilities directory. As stated above, the R.app GUI only works with this option!

Steps 1-3 are needed only the first time, and if not done previously:

1) Install R.app (the R for Mac OS X GUI). If you select 'Customize' during installation of R.app, make sure the entry for tcltk remains selected.

2) Check to see if X11 works by clicking the X11 icon in the toolbar of R Console once you have R.app running. By default X11 should have been installed during installation of Mac OS 10.4.x. You can close the X11 terminal window, you won't need it (but DO NOT quit X11 itself).

3) Install the Rcmdr package either using the R Package Installer (make sure to check the 'Install dependencies' box), or enter the command install.packages("Rcmdr", dependencies=TRUE) in the R console window. Currently Rcmdr depends on the packages abind, car, effects, lmtest, multcomp, mvtnorm, relimp, sandwich, strucchange, zoo and rgl. If in doubt, using Packages & Data/Package Installer you can check if these have indeed been installed. Note: The packages on which the Rcmdr depends also have dependencies, which have dependencies, etc., so many  packages get installed; with a fast Internet connection, the process should go quickly, however. At the time of writing, there is an indirect dependency on one of the Bioconductor packages (Biobase), which will not be installed unless you have selected a Bioconductor package repository; the absence of this package seems to do no harm.

Once these are installed:

4) Start R (e.g. double-click the R icon in /Applications).
5) Start X11 (e.g. click the X11 button on the R Console or double-click the X11 icon in /Applications/Utilities).
6) Close the X11 terminal (optional -- but DO NOT quit X11 itself).
7) Type library(Rcmdr) in the R Console and press Return.

The Rcmdr window will open up.

8) For a quick test/tour:
8.1) Check that most of the menu items are greyed-out before a data set is read.
8.2) Read the Prestige data set from the car package, via Data -> Data in packages -> Read data from an attached package.
8.3) Test standard R graphics via Graphs -> Index plot, selecting income; then try a 3D plot of prestige vs. income and education; the 3D plot requires that the rgl package is installed.
8.4) Fit a linear model, regressing prestige on education, income, and type, via Statistics -> Fit models -> Linear model.
8.5) Test the linear hypothesis that the two coefficients for type are 0, via Models -> Hypothesis tests -> Linear hypothesis.
8.6) Finally, test lattice graphics via Models -> Graphs -> Effect plots.

9) Once you exit from the R Commander GUI (but not from R), you can type Commander() to restart the R Commander.
10) If you save/restore the R workspace, you will need to start X11 before starting R! After the workspace is restored, type library(Rcmdr) again.

Note: Closing a graphics window occasionally crashed R. This problem was solved in R 2.10.0 (thanks to Rob Goedman).


Last modified: 29 October 2009 by John Fox <jfox AT mcmaster.ca>.