title: I want to create a data.frame with the values that I print of this loop in R
body: <p>When I run this Loop I can print the results and I want to create a data frame with this data but I cant. Until now I have this:</p>
  
  <pre><code>filenames &lt;- list.files(path=getwd())  
  numfiles &lt;- length(filenames)  
  for (i in 1:numfiles) {
    file &lt;- read.table(filenames[i],header = TRUE)
    ts = subset(file, file$name == "plantNutrientUptake")
    tss = subset (ts, ts$path == "//plants/nitrate")
    tssc = tss[,2:3]    
    d40 = tssc[41,2]
    print(d40)
    print(filenames[i]) 
  } 
  </code></pre>