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 start it. Ok, it really didn't annoy me that bad, but I wanted it to be easier for students to start Rcmdr if they were in a computer lab (I help set up the Math Lab here at my school).

Well, I figured how to create a shortcut that will start R AND Rcmdr! Here are the steps:

  1. Open up the C:\Program Files\R\R-2.10.1\etc (or similarly named version directory).
  2. Edit the file and add the following 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!
          defpack = getOption("defaultPackages")
          mylibs = c("tcltk","car","lattice","MASS","Matrix")
          if(Sys.getenv("RCMDR") == "TRUE") mylibs = c(mylibs,"Rcmdr") 
          options(defaultPackages = c(defpack,mylibs))
  3. Next, copy the shortcut that is used to run R onto 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 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