Making a Shortcut to Rcmdr!

Ever since I learned about Rcmdr, I was annoyed that I had to type library(Rcmdr) into R everytime I wanted to use it. Ok, it didn't really annoy me, but every student that I helped to install this would be scared to type it in. They are used to point and click. I wanted it to be easier for students to start Rcmdr if they were in a computer lab. These instructions will allow a sysadmin to create a shortuct on the desktop that will automatically load Rcmdr clicked.

Here are the steps:

  1. Open up the directory C:\Program Files\R\R-2.10.1\etc (or similarly named version directory).
  2. In this directory, edit the file Rprofile.site and add the following lines:
          defpack = getOption("defaultPackages")
          mylibs = c("tcltk","car","lattice","MASS","Matrix")
          if(Sys.getenv("RCMDR") == "TRUE") mylibs = c(mylibs,"Rcmdr") 
          options(defaultPackages = c(defpack,mylibs))
          
    Here's the explanation of these lines: The mylibs variable is a list of packages that you want starting up each time you run Rcmdr. Both lattice and MASS are depencies of Rcmdr and need to be loaded. If you load them this way, they are loaded SILENTLY (no output on the screen)!
  3. Next, create a copy of the shortcut to R and place it on the desktop. Right click on the file, and select properties. Add the following to the end of the "Target:"
          "C:\Program Files\R\R-2.10.1\bin\Rgui.exe" --sdi RCMDR=TRUE
          
    Notice that the options --sdi RCMDR=TRUE are OUTSIDE of the quotation marks.
  4. Change the name of the shortcut you just made to "Rcmdr"
  5. Double click on it, and both R and Rcmdr start!
S. Hyde
Last modified: Fri Jan 19 01:13:53 HST 2018