Install R Commander

Introduction

R Commander is an R package. It’s a large package, and requires installation of many additional packages. A quick guide about how to install R Commander onto your computer (LDE). You must have R installed and working correctly before proceeding to install the R Commander package. Click here to get the Install R guide.

Note: If you plan to run R in the Cloud, you cannot install the R Commander package, which must be part of a local development environment.

Installation guides quickly become outdated. This page last updated 15 August 2021 and describes working installation protocols at that time.

For BI311, we also use R Commander

R Commander is a package that adds function to R; it provides a familiar point-and-click interface to R, which allows the user to access functions via a drop-down menu system (Fox 2017). Thus, instead of writing code to run a statistical test, Rcmdr provides a simple menu driven approach to help students select and apply the correct statistical test. R Commander also provides access to Rmarkdown and a menu approach to rendering reports.

To install R Commander, enter the following code at the R prompt.

install.packages("Rcmdr")

In addition, download and install the plugin

install.packages("RcmdrMisc")

Note: You can combine requests as follows

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

Adding “dependencies=TRUE” will also install other packages that Rcmdr needs (which would get downloaded once you start Rcmdr for the first time).

If you have not set a mirror site, you’ll be prompted to do so before you can download and install packages. I recommend 0-Cloud as default mirror site. Be advised: because our university shares a single public IP address, you may experience download delays if we all try to use the same mirror site at the same time.

To start R Commander, load the packages via the library() command.

library(Rcmdr)

Follow installation prompts. You can skip adding the “otools,” for now. However, Rcmdr will prompt you to install otools every time you start, so go ahead and install them at your convenience.

Mac users: To improve Rcmdr performance you must turn off “app nap.” From Rcmdr, go to Tools, then select “Manage Mac OS X app nap for R.app …” Once you select “off” (click OK to apply), restart Rcmdr, the delay will be removed. Windows 10 folks don’t have to contend with nap.

Add pandoc and LaTex support

To complete your R Commander installation you’ll want to add additional document handling software support by adding LaTex and pandoc. In Rcmdr, select Tools, then Install Auxillary Software. Click OK, which will open links in your default browser to download pages for LaTex and pandoc. Download the files, follow the installation instructions for pandoc and LaTeX, then restart R and Rcmdr.

Here are direct links to the files, plus installation notes

LaTeX

  • MikTeX from https://miktex.org/download for Windows systems
  • MacTeX from https://www.tug.org/mactex/ for MacOSX
    • Note the full installation is 4Gb. This is definitely overkill, but does provide all of the tools you could ever need. Other alternatives with smaller downloads require knowledge about what components are needed. So, in short, go for the large download, it’s a simpler choice.
    • Be also advised: If you are running macOS before 10.14, you will have to jump through additional hoops to get macTeX installed.

pandoc

Windows 10/11

https://github.com/jgm/pandoc/releases/download/2.14.1/pandoc-2.14.1-windows-x86_64.msi

MacOS

https://github.com/jgm/pandoc/releases/download/2.14.2/pandoc-2.14.2-macOS.pkg

 

Test Rcmdr

Figure 3 shows a basic R Commander session. Enter code in the script window (1), click on the Submit button to run the code, and results show up in the output window (2).

R Commander on WinPC

Figure 3. Screenshot of basic R Commander session on WinPC.

Click on R Markdown tab, edit (e.g., replace with your own title and name), then click on the Generate Report button to create a pdf of your work, default file name is RcmdrMarkdown.pdf (Fig. 4). If you do not have pandoc and LaTeX properly installed, then only an HTML document will be available as an option.

Screenshot of RcmdrMarkdown.pdf

Figure 4. Screenshot of portion of RcmdrMarkdown.pdf.