[R] BATCH and tcltk

Dirk Eddelbuettel edd at debian.org
Thu Apr 17 16:52:59 CEST 2003


On Thu, Apr 17, 2003 at 04:20:53PM +0200, Peter Dalgaard BSA wrote:
> > I try to write a batch (in Windows, i have to use!) with 
> > Rcmd BATCH D:\Test.R D:\Test.Rout and
> > Rterm.exe --no-restore --no-save < D:\Test.R > D:\Test.Rout.
> > 
> > In my file Test.R are any tk-codelines (like: Window1 <- tktoplevel(); ... tkbutton...).
> > It works not interactifly, what is written in Rcmd BATCH --help.
> > 
> > Exist there a way to do it all the same?
[...]
> 
> I haven't messed with this on Windows for a while, but it might help
> to stick a tkwait.variable("foo") or something like that at the end of
> your input script. The thing is to get Tcl's event loop going - R
> usually drives it from the keyboard entry loop, but there is none in
> batch mode.

The tkttest.R demo works fine in batch mode, so you coukld study that
example:

~:> cp /mnt/d/R/rw1062/library/tcltk/demo/tkttest.R .
~:> Rcmd.exe BATCH  tkttest.R   

This is from a Cygwin shell, but that does not matter.

Hth, Dirk

-- 
Don't drink and derive. Alcohol and algebra don't mix.



More information about the R-help mailing list