R Commander installation in R on Linux

Table of Contents
Motivation
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.
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:
- Open a terminal (CTRL+ALT+T) and log in as administrator using the console command:
sudo -i
- Install the required software for Tcl/Tk execute at the console prompt:
apt install tcl tk tk-table cmake libgmp3-dev libmpfr-dev
- 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:
-
Start R by executing in at the console prompt:
R
-
At the R console prompt execute the following command:
install.packages("Rcmdr")
- 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:
install.packages("RcmdrPlugin.HH")
First time use of R Commander
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:
‘Rcmdr’ namespace cannot be unloaded:
namespace ‘Rcmdr’ is imported by ‘RcmdrPlugin.HH’ so 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.