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, aplpack, car, colorspace, effects, Hmisc, leaps, lmtest, multcomp, relimp, rgl, and (on Windows) RODBC and XLConnect. Many of these packages have their own dependencies, which depend on still other packages, etc.

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 or via the command

install.packages("Rcmdr")

When you first load the Rcmdr package with the command library(Rcmdr), it will offer to download and install missing dependencies; allow it to do so. If you installed R in Program Files under Windows Vista or Windows 7, you should run R with adminstrator privileges to install packages: Right click the R icon and select "Run as administrator." I suggest that you install R into a different directory, such as C:\R\, to avoid this issue.

On Windows, the Rcmdr package works best with the single-document Rgui interface (SDI). Under the default multiple-document interface (MDI), Tk dialog boxes may not 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\R-2.15.1\bin\Rgui.exe" --sdi. If you wish, change the name of the icon on the General tab (e.g., to R 2.15.1 SDI). Click OK. Alternatively, you can install R to use the SDI, or you can edit the Rconsole file in R's etc subdirectory.

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 if you have an active Internet connection is to run R as root and issue the command install.packages("Rcmdr") 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")
It is also possible to install R and R packages from the Ubuntu package respository but these are almost always out of date. When you first load the Rcmdr package with the command library(Rcmdr), it will offer to download and install missing dependencies; allow it to do so.

Mac OS X

These instructions are for R version 3.0.1 or later; if you're using an earlier version of R, I suggest that you upgrade, or, failing that, consult the special Mac OS X installation notes for the R Commander under older versions of R. R 3.0.1 only supports Mac OS X version 10.6.8 (Snow Leopard) or greater. Please read these instructions carefully: They are a little complicated.

            install.packages("Rcmdr")

R will ask you to select a CRAN mirror; pick a mirror site near you.

(1) You can avoid the problem by running R in a terminal window rather than using R.app. There really is no reason to prefer running the R Commander in R.app, so using R from a terminal should be perfectly fine .

(2) You can prevent your computer from napping when R.app is running, even if it's not visible, by right-clicking (or control-clicking) on R.app in the Applications folder in the Finder, and selecting Get Info from the context menu. Check the box next to Prevent App Nap. This change is permanent until you reverse it by unchecking the box.

Mac OS X Trouble-shooting

Occasionally, the Rcmdr package will fail to load properly in Mac OS X. When this problem occurs, the cause is almost always the failure of the tcltk package to load --The Rcmdr package depends on the tcltk package. You can confirm this diagnosis by trying to load the tcltk package directly, in a fresh R session, issuing the command library(tcltk)at the R command prompt.

You can verify the source of this problem by issuing the following command at the R command prompt:

system("ls -ld /usr/local /usr/local/lib /usr/local/lib/libtcl*")

If there is a file-permissions problem, you should see something like

ls: /usr/local/lib: Permission denied
ls: /usr/local/lib/libtcl*: Permission denied
drwx------  8 root  wheel  272 Sep 24 10:21 /usr/local

Having confirmed the problem, you can change the file permissions in /usr/local by opening a terminal window on your Mac (Terminal.app is in the Applications Utilities folder), and entering the following command at the $ prompt in the terminal window:

The operating system will ask you to supply your password to execute this command.

If you are using Mac OS X 10.9 ("Mavericks") and the R Commander becomes slow or unresponsive, you can run R and the R Commander in a terminal window on your Mac rather than from R.app or prevent your computer from "napping" while R.app is running.. See the installation notes above.


Last modified: 4 December 2013 by John Fox <jfox AT mcmaster.ca>.