title: Apply a function to a set of .csv with similar names
body: <p>I wish to apply a really simple function in <code>R</code></p>
  
  <pre><code>BasicFun &lt;- function(x) {
    c(min = min(x), max = max(x), 
      mean = mean(x))
  }
  </code></pre>
  
  <p>To a specific column called "Values" always present in a set of <code>.csv</code> files, all with very similar names (<code>basedata10people.csv</code>, <code>basedata20people.csv</code>, etc...), these names follow: </p>
  
  <pre><code>seq(10, 300, by=10)
  </code></pre>
  
  <p>So I am looking to do something like:</p>
  
  <pre><code>names &lt;- seq(10, 300, by=10)    
  for (i in 1:names) {    
   {    
   file[[i]] = read.csv(file=paste("basedata", [[i]], "people", sep=""))    
   a=BasicFun(file[[i]]$Values)    
   results[[i]] = rbind(a)    
    }    
    allresults = rbindlist(results)    
    write.csv(allresults, file=paste("allresults.csv", sep=""))    
  }    
  </code></pre>
  
  <p>With the aim to compile all those results in a single <code>.csv</code>, that would look something like:</p>
  
  <pre><code> file min max mean     
   10   30  80   52    
   20   27  89   60    
   30   25  91   50 
  </code></pre>
  
  <p>Any help or advise will be greatly appreciated.</p>