On Sun, 8 Feb 2004 16:07:44 -0500, you 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.
The apply() and related functions do iteration over various things, and list.files() and choose.files() select files (the latter interactively on Windows). So something like this might do what you want: lapply(list.files(), function(x) paste('filename is ',x)) Duncan Murdoch ______________________________________________ [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