title: R + convert a list of results into data frame
body: <p>I am working on multiple csv files in one go. </p>
  
  <pre><code>getResult&lt;-function(df){
    c(runif(1, 0, 1), runif(1, 0, 1))
  }
  
  filenames &lt;- list.files("temp", pattern="*.csv", full.names=TRUE)
  ldf &lt;- lapply(filenames, read.csv)
  res &lt;- lapply(ldf, getResult)
  </code></pre>
  
  <p>In 'getResult' function I am calculation two float values. Finally I need a data frame with filenames and the two 'float' values. How do I do that? </p>
  
  <p>I tried doing the following:</p>
  
  <pre><code>data.frame(res,filenames)
  </code></pre>
  
  <p>But I don't get the desired result. Can someone guide?</p>
  
  <p>Thanks.</p>
  
  <p>Adding partial dput(res) output:</p>
  
  <pre><code>list(c(0, 0.11340206185567), c(0, 0.0317919075144509), 
  c(0, 0.0569948186528497))
  </code></pre>