R Commander installation in R on Linux

Image credit: Unknown on Google
Table of Contents


At Wageningen University & Research the Linux Operating System is supported on a best effort principle, meaning that it is supported as far as the knowledge of Facilities and Services Information Technology (FB-IT) reaches. FB-IT is supported by their colleagues maintaining the High Performance Computing Cluster Anunna, who have a lot of knowledge about the Linux Operating System, because it’s the Operating System used by Anunna.

On the other hand Linux users are generally users, who are very independent and know how to search for and implement solutions themselves. Being one of those Linux users within WUR myself I want to share in this post, how I have installed R Commander in R on my Linux Systems within Wageningen University & Research.

This post will show how to install R Commander in R on a Linux desk- or laptop computer.

Installation R Commander

Prior requirement for installing R Commander on Linux:

To be able to install R Commander you will need to have R installed first. If you haven’t done so already, please read R installation on Linux (use the link above to go to that specific post) before continuing with this post.

Tcl/Tk for R Commander

R Commmander has been programmed in Tcl (Tool Command Language) and uses Tk as a graphical user interface toolkit. To be able to use R Commander correctly on Linux, software needs to installed that enables the use of Tcl/Tk.

To install Tcl/Tk on your Linux system perform the following steps:

  1. Open a terminal (CTRL+ALT+T) and log in as administrator using the console command:
sudo -i
  1. Install the required software for Tcl/Tk execute at the console prompt:
apt install tcl tk tk-table cmake libgmp3-dev libmpfr-dev
  1. Exit out of administrator mode using the exit command. Do not close the terminal application!

Installation of CRAN packages for R Commander

R Commander can be started from within R, when all required packages are installed from the Comprehensive R Archinve Network (CRAN). To install the packages perform the following steps in the open terminal:

  1. Start R by executing in at the console prompt: R

  2. At the R console prompt execute the following command:

When asked to select a CRAN mirror, pick the “0-cloud” mirror. This will always select the CRAN mirror nearest to your location.
  1. Additional required packages can be installed using the install.packages() function. For example to add R Commander support for the Statistical Analysis and Data Display: Heiberger and Holland package use:
Congratulations, you can now use R Commander in R on your Linux Operating System!

First time use of R Commander

When using R Commander for the first time additional packages required for R Commander to work correctly will need to be installed. Allow the installation to be able to work smoothly without errors!

To start R Commander from the R Console, type the command library(Rcmdr) behind the prompt and execute.

Restarting R Commander

In case R Commander crashes while using it, you will need to resart it. However, in the R Console or in the active terminal console currently running R, the library(Rcmdr) command will not restart R Commander.

The reason is, that the R Commander package is still loaded and first needs to be detached. To detach the R Commander package execute the following command:

detach("package:Rcmdr", unload = TRUE)

When a plugin has been loaded, e.g, RcmdrPlugin.HH a warning message will be shown at the R prompt:

Warning message:
Rcmdrnamespace cannot be unloaded:
  namespaceRcmdris imported byRcmdrPlugin.HHso cannot be unloaded

To be able to restart R Commander, first the plugin needs to be detached. Execute for example:

detach("package:RcmdrPlugin.HH", unload = TRUE)

Next re-execute at the R console prompt:

detach("package:Rcmdr", unload = TRUE)

Now R Commander can be restarted by using the library(Rcmdr) command as before.

Maikel Verouden, Ph.D.
Maikel Verouden, Ph.D.
Researcher | Lecturer | IT & Organization contact person

My research interests include Statistics, Teaching and programmable matter (statistical software).