Re: [R] processing all files with certain extension in a directory

2010-01-15 Thread Benilton Carvalho
theFiles <- list.files(inputdir, full=T, pattern="\\.[eE][xX][tT]$") for (file in theFiles){ ... } On Fri, Jan 15, 2010 at 11:43 AM, Albert Vilella wrote: > Hi all, > > I'm trying to process all files with a certain extension "*.ext" in a > directory like this: > >> R --slave --args /my/dir < di

Re: [R] processing all files with certain extension in a directory

2010-01-15 Thread Remko Duursma
Albert, try something like this: extfiles <- list.files(pattern=".ext") for(f in extfiles){ process.data(f) #etc } greetings, Remko - Remko Duursma Post-Doctoral Fellow Centre for Plants and the Environment University of Western Sydney H

[R] processing all files with certain extension in a directory

2010-01-15 Thread Albert Vilella
Hi all, I'm trying to process all files with a certain extension "*.ext" in a directory like this: > R --slave --args /my/dir < dir_plot.r where I then I want to do something like: myarg <- commandArgs() inputdir <- myarg[length(myarg)] print(inputdir) "for file with extension "*.ext in inputdi