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

From: Sean Davis <sdavis2_at_mail.nih.gov>
Date: Sun 22 May 2005 - 11:09:10 EST

> Hello,
>
> Let's say I have 50 R scripts to run. What would be the most efficient
> way
> to run them?

> Is there an easier way? Something like calling R from R and specifying
> that
> the script has to be finished before continuing.

How about something like (untested):

for (i in 1:50) {
  filename <- paste('/path/to/files/',i,'.txt',sep="")   source(filename)
}

As an alternative, if you know the filenames and have them in an R vector called filenames, you could do:

for (i in filenames) {
  source(i)
}

Sean



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun May 22 11:13:15 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:59 EST