title: How to add a record to a dataframe using rbind in R
body: <p>I am trying to add rows to a dataframe using rbind in R.  However, the dataframe is not being updated each time I attempt to add a row.  In other words, the following code results in a dataframe with 2 columns but 0 observations when it should have 2 columns with 2 observations.</p>
  
  <pre><code>modeldata2&lt;-data.frame(Model=character(),Accuracy=numeric())
  
  modelname&lt;-"A"
  accuracystr2&lt;-2.2
  rbind(modeldata2,list(modelname,accuracystr2))
  
  modelname&lt;-"B"
  accuracystr2&lt;-3.2
  rbind(modeldata2,list(modelname,accuracystr2))
  </code></pre>
  
  <p>I am using this at the end of a loop to record values and therefore need to first initialize an empty dataframe and then add records to the dataframe at the end of each loop.  The code above is just an example that I am using to troubleshoot the problem.  I have also tried using c instead of list but the result was the same.</p>