Wednesday, August 10, 2011

R Commander: A Basic-Statistics GUI for R

R Commander

Screenshot from the site:


From the website:

For more details, see my paper on the R Commander in the Journal of Statistical Software.

The R-Commander GUI consists of a window containing several menus, buttons, and information fields. (The menu tree, etc., are shown below.) In addition, the Commander window contains script and output text windows. The R-Commander menus are easily configurable through a text file or, preferably, through plug-in packages.

The menus lead to simple dialog boxes, the general contents of which are more or less obvious from the names of the menu items. These boxes have a common structure, including a help button leading to the help page for a relevant function.

By default, commands generated via the dialogs are posted to the output window, along with printed output, and to the script window. Lines in the script window can be edited and (re)submitted for execution. Error messages, warnings, and "notes" appear in a messages window.

Commands access a current or active data set (data frame). When a new data set is read (from an attached package or imported), it becomes the active data set. The user can also select an active data set from among data frames currently in memory.

In addition to standard packages, the Commander uses functions in a number of other packages: abind, aplpack, car, colorspace, effects, Hmisc, leaps, lmtest, multcomp, relimp, rgl, and (on Windows) RODBC. To install the Rcmdr package along with all of these and their dependencies, use the command install.packages("Rcmdr", dependencies=TRUE). If any of these packages are missing, the Rcmdr will offer to install them when it starts up. Note: These other packages also have dependencies, which have dependencies, etc., so many packages get installed; with a fast Internet connection, the process should go reasonably quickly, however.

My object in designing and implementing this GUI was to cover the content of a basic-statistics course. The target text was Moore's The Basic Practice of Statistics, Second Edition (Freeman, 2000), which is the text that I used for a two-semester introduction to statistics for undergraduate sociology majors. The R Commander implements the content of this text plus some additional material (e.g., linear and generalized linear models). As a result of several suggestions that I have received, the coverage is now larger than originally envisaged.

I must confess that I'm not terribly enamored of menu/dialog box interfaces to statistical software, but I do feel that these interfaces have a role for introductory and occasional use. The Commander interface is not innovative, but I hope that it's simple and familiar. One of my design goals was to wean users from the GUI to writing commands, which is one motivation for the script window.

It is relatively easy for me to add statistical functionality to the R Commander, and I'd appreciate suggestions for what you'd like to see implemented. Please remember, however, that my intention is to keep things simple and basic. In particular, I don't like extensive menu/dialog-box interfaces to large statistical systems that attempt to provide access to every option and procedure. In R, of course, which relies on hundreds of contributed packages, this is not feasible anyway. As mentioned, the R Commander can also be extended by plug-in packages: See my article in the December 2007 issue of R News.

I'm making the GUI available as the Rcmdr package. You can get a copy of the latest released version of the Rcmdr package through CRAN. I should mention that I've only tested the package under Windows 95, 2000, XP; Vista (recent versions under Vista), and under Ubuntu Linux (earlier versions under Red Hat and Quantian Linux); and under Mac OS X. Mac OS X users in particular should see the installation notes.

The lastest version of the Rcmdr has some new features, and there are many new features beyond the original release. (See the CHANGES file in the installed or source package for details.) Version 0.9-9 introduced substantial changes to the interface, with output by default routed to an output window within the main Commander window; version 0.9-10 included rewritten dialog-box generating functions, reducing the R code for the package by about 40 percent. Development version 0.9-18 (never submitted to CRAN) introduced other substantial changes, such as conditionally activated menus. Version 1.0-0 was the first "non-beta" version. Version 1.1-1 included support for translation into other languages, using the tools for internationalization and localization introduced in R 2.1.0; please contact me if you'd like to contribute a translation of the Rcmdr package into another language. Version 1.3-0 introduced "plug-ins," which simplify extending the R Commander: See ?Plugins. There are now a number of plug-in packages on CRAN, most with names of the form RcmdrPlugin.* (e.g., RcmdrPlugin.survival).

An introductory manual (in a PDF file, up-to-date as of Rcmdr version 1.6-0) is part of the R Commander package and is accessible from its Help menu. A Spanish translation of the help page for the Commander has been generously contributed by Manuel Muñoz Márquez.

I'd very much appreciate learning about your experiences.


1 comment:

  1. I've installed R on lubuntu and it keeps asking me to install rgl every time I call Rmcdr...any hints as of why? or more important, how to fix it?
    Thanks...

    ReplyDelete