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). Many Thanks, John [[alternative HTML version deleted]]
On 3/14/10, john_j_carroll at mail.com <john_j_carroll at mail.com> wrote:> I would appreciate any assistance as soon as possible (so I don't get too far behind in my studies). >I am not sure what the exact issue is, but you can always start Rcmdr manually after the R start-up. Simply issue a require(Rcmdr) to load Rcmdr. Liviu
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 Sys.getenv("R_USER") 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: setwd(Sys.getenv("R_USER")) writeLines(' 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.
Dear John, These instructions appear to come from your instructor, and you might try asking him or her what to do. Duncan Murdoch has already suggested that you might not have permission to edit a file in Program Files, and explained an alternative. You could also try running Notepad as administrator to edit the Rprofile.site file. And you could reinstall R to a location other than Program Files where you have the ability to edit files. I hope this helps, John -------------------------------- John Fox Senator William McMaster Professor of Social Statistics Department of Sociology McMaster University Hamilton, Ontario, Canada web: socserv.mcmaster.ca/jfox> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]On> Behalf Of john_j_carroll at mail.com > Sent: March-14-10 1:23 AM > To: r-help at r-project.org > Subject: [R] R and R commander > > > Hi, > > I am a student studying Biostatistics at University. We have been advisedto> install R and R commander. I managed to do this successfully, except Iwasn't> able to complete the final step - which would enable both R and Rcommander> 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 aboutchecking> now? > 7. You can check if this has worked by first closing down R. To exit Rsimply> 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 Messagesbox> 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. Ensurethat> 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 toofar> behind in my studies). > > 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 guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.