title: Appending list to data frame in R
body: <p>I have created an empty data frame in R with two columns:</p>
  
  <pre><code>d&lt;-data.frame(id=c(), numobs=c())
  </code></pre>
  
  <p>I would like to append this data frame (in a loop) with a list, <code>d1</code> that has output:</p>
  
  <pre><code>[1] 1  100
  </code></pre>
  
  <p>I tried using <code>rbind</code>:</p>
  
  <pre><code>d&lt;-rbind(d, d2)
  </code></pre>
  
  <p>and <code>merge</code>:</p>
  
  <pre><code>d&lt;-merge(d, d2)
  </code></pre>
  
  <p>And I even tried just making a list of lists and then converting it to a data frame, and then giving that data frame names:</p>
  
  <pre><code>d&lt;-rbind(dlist1, dlist2)
  dframe&lt;-data.frame(d)
  names(dframe)&lt;-c("id","numobs")
  </code></pre>
  
  <p>But none of these seem to meet the standards of a routine checker (this is for a class), which gives the error:</p>
  
  <pre><code>Error: all(names(cc) %in% c("id", "nobs")) is not TRUE
  </code></pre>
  
  <p>Even though it works fine in my workspace.</p>
  
  <p>This is frustrating since the error does not reveal where the error is occurring.</p>
  
  <p>Can anyone help me to either merge 2 data frames or append a data frame with a list?</p>