title: cor.test into data.frame in R
body: <p>consider the following example:</p>
  
  <pre><code>require(MuMIn)
  data(Cement)
  d &lt;- data.frame(Cement)
  
  idx &lt;- seq(11,13)
  cor1 &lt;- list()
  for (i in 1:length(idx)){
    d2 &lt;- d[1:idx[i],]
    cor1[[i]] &lt;- cor.test(d2$X1,d2$X2, method = "pearson")
  }
  out &lt;- lapply(cor1, function(x) c(x$estimate, x$conf.int, x$p.value))
  </code></pre>
  
  <p>Here I calculate the correlation for a dataset within an iteration loop. </p>
  
  <p>I know want to generate one data.frame made up of the values in the list 'out'. I try using </p>
  
  <pre><code>df &lt;- do.call(rbind.data.frame, out)
  </code></pre>
  
  <p>but the result does not seem right:</p>
  
  <pre><code>&gt; df
    c.0.129614123011664..0.195326511912326..0.228579470307565.
  1                                                  0.1296141
  2                                                  0.1953265
  3                                                  0.2285795
    c..0.509907346173941...0.426370467476045...0.368861726657293.
  1                                                    -0.5099073
  2                                                    -0.4263705
  3                                                    -0.3688617
    c.0.676861607564929..0.691690831088494..0.692365536706126.
  1                                                  0.6768616
  2                                                  0.6916908
  3                                                  0.6923655
    c.0.704071702633775..0.542941653020805..0.452566184329491.
  1                                                  0.7040717
  2                                                  0.5429417
  3                                                  0.4525662
  </code></pre>
  
  <p>This is not what I am after. </p>
  
  <p>How can I generate a data.frame that has the first column expressing which list the cor.test was calcuated i.e. 1 to 3 in this case, the second column referring to the $estimate and then $conf.int and %p.value resulting in a five column data.frame. </p>