[R] iterating over files in a directory with R

Tom Blackwell tblackw at umich.edu
Sun Feb 8 22:13:33 CET 2004


Try  help("list.files"), help("file.info"), help("file"),  and
look in the "see also" section in each of those help files for
other functions which you may find useful for doing this.

-  tom blackwell  -  u michigan medical school  -  ann arbor  -

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 }
>
> Could someone please give me a pointer to how (or if) this might be done with R - I haven't yet been able to find anything relevant in the manuals.  Or would I need to call each file with some language such as Java and then use R once I have the file name?
>
> Thanks for your help,
>
> femke
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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
>




More information about the R-help mailing list