G'day Hadley, On Tue, 16 Dec 2008 18:54:48 -0600 "hadley wickham" <h.wick...@gmail.com> wrote:
> On Tue, Dec 16, 2008 at 5:40 PM, Prof Brian Ripley > <rip...@stats.ox.ac.uk> wrote: > > On Tue, 16 Dec 2008, hadley wickham wrote: [...] > >> Is it possible to programmatically minimise the main window of the > >> windows R gui? I'm designing a small gui with gwidgets & RGtk2 > >> for an non-statistician to use, and it would be nice if I could > >> easily hide all the R stuff that they don't need. > > > > Not from R itself, but you can by Windows script programming (which > > you can launch by 'system'. It would also be esay to add a small > > bit of C code to do so. [...] Not sure if this is what you are after, but I believe we had once a similar problem. Client wanted to have a GUI that would read in a file with the list of people who had bought Raffle tickets, select the winners, and write the winners to a file. They were just interested in seeing the GUI stuff and not the underlying R main window &c. We ended up giving them an USB stick with R on it and the package we wrote for them together with other packages they needed. I attach the instructions that I wrote up for our consultant (sitting in Perth) on how I could create such an USB stick (sitting in Singapore). UWA has an authenticating proxy while NUS does not, hence the references to "--internet2" on that write up. As it turned out, if you do not use the standard way of installing R but select SDI during the installation (if memory serves correctly, this choice can also be made after R is installed, but then doing this change is a bit more involved), then you can start R "minimized". That is the R main window does not appear. You just have to make sure that your code is executed when you start R (via .onAttach, .First &c) and brings up the GUI that the user is supposed to see. HTH. Cheers, Berwin =========================== Full address ============================= Berwin A Turlach Tel.: +65 6515 4416 (secr) Dept of Statistics and Applied Probability +65 6515 6650 (self) Faculty of Science FAX : +65 6872 3919 National University of Singapore 6 Science Drive 2, Blk S16, Level 7 e-mail: sta...@nus.edu.sg Singapore 117546 http://www.stat.nus.edu.sg/~statba
1) Install R on USB stick: Start R installer (named something like (R-2.x.y-win32.exe). During installation: i) Select drive corresponding to USB stick for location to which R is to be installed (i.e. if USB stick is drive DRV, then install R to location DRV:\R-2.x.y). ii) Customize startup: a) select SDI, everything else per default b) may be necessary to select internet2 as internet connection if sitting behind a proxy (but it is also possible to do so later, i.e o.k. to use the default) iii) Don't create a "Start Menu folder" iv) Don't create desktop icon or registry entries 2) Create a short cut to Rgui.exe (located in DRV:\R-2.x.y\bin\Rgui.exe) and move it to the top folder of the USB stick. Optionally, rename short cut (e.g. Raffle Draw) 3) Start R using the short cut. 4) Select "Install package(s) from local zip files" from Packages menu: select RaffleDraw_1.y.zip (currently y=1, but may change) for installation. 5) Select "Install package(s)..." from Packages menu: select appropriate CRAN mirror, then select gWidgets and gWidgetsrJava to be installed. quit R If this step does not work, then you are probably sitting behind a proxy. In that case, go to the short cut that points to Rgui.exe, right click on the short cut and select properties from pop-up window; add "--internet2" to the target (i.e. the target should read something like "DRV:\R-2.x.y\bin\Rgui.exe --internet2"). Click "Apply" and then "Ok" and try again. 6) Right-click on short cut and select properties from pop-up window; change entry for "Run:" from "Normal window" to "minimized". Click "Apply" and then "Ok". (Remove the "--internet2" option if it had been added) 7) Goto to the folder DRV:\R-2.x.y\etc and edit the Rprofile.site file located in that folder: add "library(RaffleDraw)" as last line (without the quotation marks) save file and quit 8) go to top folder of USB stick and double click on the short cut.
______________________________________________ R-help@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.