Scott Hyde
2009-Jul-15 08:30 UTC
[R] Starting RCmdr from the Commandline (and a shortcut) in Windows
I thought I'd share the experience I had in getting Rcmdr to start automatically when R starts up. I'd read of solutions that would start Rcmdr every time R started up, but I didn't want it to start every time, only when I wanted it to. First, I created a shortcut on the desktop to R and changed its name to Rcmdr. Next, I changed the target of the shortcut to (edit the version number if needed): "C:\Program Files\R\R-2.9.1\bin\Rgui.exe" --sdi RCMDR=TRUE I added the options --sdi (I like this interface the best) and created the RCMDR=TRUE environmental variable. Next, I edited the Rprofile.site file in the etc directory of the R installation and added the following lines to the bottom: defpack = getOption("defaultPackages") mylibs = c("lattice","MASS","Matrix") if(Sys.getenv("RCMDR") == TRUE) mylibs = c(mylibs,"Rcmdr") options(defaultPackages = c(defpack,mylibs)) Note that mylibs is the list of libraries that I wanted autoloaded. Although Matrix will autoload lattice, I didn't want it to announce it every time R started, so I loaded it first. Now clicking on Rcmdr on the desktop starts up Rcmdr (in addition to R), and starting up R regularly does not start Rcmdr, which is what I wanted! I hope someone else may find this useful! -Scott ***************************************************************** Scott K. Hyde Assistant Professor of Statistics and Mathematics College of Math and Sciences Brigham Young University -- Hawaii Laie, HI 96762 [[alternative HTML version deleted]]