title: Loop to dynamically fill dataframe R
body: <p>I am running a for loop to fill dynamically a dataframe (I know a baby seal dies somewhere because I am using a for loop)</p>
  
  <p>I have something like this in mind (the 5 is a placeholder for a function that returns a scalar):</p>
  
  <pre><code>results&lt;-data.frame(matrix(NA, nrow = length(seq(1:10)), ncol = 
  length(seq(1:10))))
  rows&lt;-data.frame(matrix(NA, nrow = 1, ncol = 1))
  for (j in seq(1:10)){
  rows&lt;-data.frame()
  for (i in seq(1:10)){
     rows&lt;-cbind(rows,5)
  }
  results&lt;-cbind(results,rows)
  }
  </code></pre>
  
  <p>I get the following error message with my approach above. </p>
  
  <pre><code>Error in match.names(clabs, names(xi)) : 
  names do not match previous names
  </code></pre>
  
  <p>Is there an easier way? </p>