Dear R-help, Reccently I've been working on sample size estimates for our forensic scientists and have to make the work accessible to them, preferably in some Windows based graphical form. The obvious choise was Tk via R, so I now have a couple of very nice, user friendly front ends for calculating betas and beta-binomials which run equally well under Windows and other systems (same code - amazing). The problem is that the habitual users of windows are going to get flummoxed firing up R then sourcing the script files, so what I have been trying to do, without success, is link a batch file to run the script as a batch without ever seeing the terminal (or gui version in windows). Problem is running R as a batch disables graphics plotting, and the toplevel fires up, but then just shuts down again. Are there any modifying parameters I can pass to R to make it run in the background with a graphics device enabled? I've done all the usual searches through the archives and FAQ's etc. Dave. ********************************************************************** ** Dr. David Lucy ** ** Joseph Bell Centre for Forensic Statistics and Legal Reasoning ** ** Department of Mathematics and Statistics ** ** The University of Edinburgh ** ** James Clerk Maxwell Building ** ** King's Buildings ** ** Mayfield Road ** ** Edinburgh ** ** EH9 3JZ ** ** ** ** tel: 0131 650 5057 ** ** extension: 505057 ** ** e-mail: dlucy at maths.ed.ac.uk ** ** ** ** Truncated address: ** ** ** ** Dr. David Lucy ** ** Department of Mathematics ** ** JCMB ** ** King's Buildings ** ** Edinburgh University ** ** Edinburgh ** ** EH9 3JZ ** ********************************************************************** -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Mon, 28 Jan 2002, David Lucy wrote:> Dear R-help, > > Reccently I've been working on sample size estimates for our forensic > scientists and have to make the work accessible to them, preferably > in some Windows based graphical form. The obvious choise was Tk via R, > so I now have a couple of very nice, user friendly front ends for > calculating betas and beta-binomials which run equally well under > Windows and other systems (same code - amazing). > > The problem is that the habitual users of windows are going to get > flummoxed firing up R then sourcing the script files, so what I have > been trying to do, without success, is link a batch file to run the > script as a batch without ever seeing the terminal (or gui version in > windows). Problem is running R as a batch disables graphics plotting,Not true on Windows, and only true on Unix if R CMD BATCH is used.> and the toplevel fires up, but then just shuts down again.Right. So you have to give it something to do, like wait at a prompt (equally true on Unix).> Are there any modifying parameters I can pass to R to make it run in the > background with a graphics device enabled? I've done all the usual > searches through the archives and FAQ's etc.1) In non-interactive use the default plotting device is postscript(). So you either want to explicitly open a windows() device, or alter the option which is set in Rprofile to if(interactive()) options(device="windows") else options(device = "postscript") 2) I think you want to do all this via a .Rprofile file. Or set the batch file to set R_PROFILE to point to a suitable file and use that as the equivalent of Rprofile.site. Then use rterm --slave and make the `dos' windows of the batch file come up minimized. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
David Lucy <dlucy at maths.ed.ac.uk> writes:> Dear R-help, > > Reccently I've been working on sample size estimates for our forensic > scientists and have to make the work accessible to them, preferably > in some Windows based graphical form. The obvious choise was Tk via R, > so I now have a couple of very nice, user friendly front ends for > calculating betas and beta-binomials which run equally well under > Windows and other systems (same code - amazing).This almost works, but there seems to be a bug in Rterm/Tcl preventing R from closing up properly (in w98 under win4lin). $ cat win/Programmer/R/rw1040/bin/tkR.bat Rterm --vanilla < tk.R $ cat win/Programmer/R/rw1040/bin/tk.R library(tcltk) tt <- tktoplevel() v <- tclVar() tkpack(tkcheckbutton(tt,variable=v)) tkwait.variable(v) tkdestroy(tt) q("no") Then make a shortcut that calls up tkR.bat. For now, it might be better to just leave the process hanging at tkwait.variable("fubar") and close stuff up by closing the controlling "DOS-box". -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._