[R] Calling R from R and specifying "wait until script is finished"

Gabor Grothendieck ggrothendieck at gmail.com
Sun May 22 13:24:47 CEST 2005


On 5/22/05, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
> Lapointe, Pierre wrote:
> > Hello,
> >
> > Let's say I have 50 R scripts to run.  What would be the most efficient way
> > to run them?
> >
> > I thought I could do multiple Rterms in a DOS batch file:
> >
> > Ex:
> > Rterm <1.R> 1.txt
> > Rterm <2.R> 2.txt
> > ...
> > Rterm <50.R> 50.txt
> >
> > However, I'm afraid they will all open at the same time.
> 
> That could be a problem if you had used Rgui (depending on which shell
> you are using), but Rterm should run until completion before the next
> line of the batch file will start.


Using Windows XP cmd, one can force waiting for Rgui to complete
like this (note the /wait):

start/wait "" "\Program Files\R\rw2010\bin\Rgui.exe"




More information about the R-help mailing list