On Sun, 8 Feb 2004, femke wrote:
> Hello,
>
> I'm an R newbie and was wondering whether there are R commands for
> iterating over files in a directory. Basically what I want to do is to
> iterate over many files and apply some R functions to each file
> seperately.
>
> e.g. for (each file in a directory) do { some R calculation with the
> info in that file }
>
sapply(list.files("a directory"), some.R.calculation)
or
files<-list.files("a directory")
for(each.file in files){
some.R.calculation
}
-thomas
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html