[R] R and R commander

Duncan Murdoch murdoch at stats.uwo.ca
Sun Mar 14 14:39:39 CET 2010

On 14/03/2010 1:23 AM, john_j_carroll at mail.com wrote:
> Hi, 
> I am a student studying Biostatistics at University. We have been advised to install R and R commander. I managed to do this successfully, except I wasn't able to complete the final step - which would enable both R and R commander to launch when I open the R icon on my desktop. 
> However, I haven't been able to save it and for this to work. 
> The last instructions we were given are:
> 3. If you wish to load the R Commander automatically when R starts, first find
> R's etc directory. In my computer, it is: C:\Program Files\R\RTopic
> 1: The Role of Statistics in Health: Populations and Samples
> PUBH7630 Course Notes 1-23
> 2.10.1\etc . Right click on the file Rprofile.site and select 'Open
> With'. Open the file with the 'notepad' program.
> 4. Go to the bottom of the brief file and copy/paste the following at the end:
> local({old <- getOption("defaultPackages")
> options(defaultPackages = c(old, "Rcmdr"))})
> (Don't include any # symbols like the already-existing text has.)
> 5. Save the file and then close it.
> 6. Next time you open R, R Commander will also pop open. How about checking
> now?
> 7. You can check if this has worked by first closing down R. To exit R simply use the
> File => Exit menus or type q() at the R command line prompt. If you want
> to close both R and R Commander at the same time, use the File => Exit
> menus in R Commander and click Exit => from Commander and R.)
> 8. Then reopen it (click the R icon or on your desktop or run R from the Programs
> menu and then reopening it). R and R Commander will sit as two separate
> windows on your computer.
> NOTE: If you have not set R to have 'SDI' then the R Commander Messages box will
> give you a warning that R Commander works best with SDI. It may not run things the way
> it should, so please follow the instructions to set R with SDI. Ensure that you have done
> the steps for all shortcuts to the R program (desktop icon, quick launch icon, start menu,
> etc).
> However, it is not saving it after I add the below info after the RProfile.site in notepad
> local({old <- getOption("defaultPackages")
> options(defaultPackages = c(old, "Rcmdr"))})
> It comes up with a message it cannot create or save the file. 
> I would appreciate any assistance as soon as possible (so I don't get too far behind in my studies). 

You don't appear to have permission to edit that file.  If you own the 
computer, you could run notepad as an administrator.  If you don't, then 
  you can put those two lines into a file named .Rprofile and put that 
file into the directory listed by


This is a little tricky to do in Windows, because Notepad won't like 
that filename.  You can do it from R by running these lines:

  local({old <- getOption("defaultPackages")
  options(defaultPackages = c(old, "Rcmdr"))})
', ".Rprofile")

Duncan Murdoch

> Many Thanks, 
> John
> 	[[alternative HTML version deleted]]
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list