title: how do you add new columns to an empty data frame in R
body: <p>I declare an empty data frame as this:</p>
  
  <pre><code>df &lt;- data.frame()
  </code></pre>
  
  <p>then I go though processing some files and as process, I need to build my <code>df</code> data frame. I need to keep adding columns to it:</p>
  
  <p>For example, I process some file and build a data frame called <code>new_df</code>, I now need to add this <code>new_df</code> to my <code>df</code>:</p>
  
  <p>I've tried this:</p>
  
  <pre><code>latest_df &lt;- cbind(latest_df, new_df)
  </code></pre>
  
  <p>I get this error:</p>
  
  <blockquote>
    <p>Error in data.frame(..., check.names = FALSE) :    arguments imply
    differing number of rows: 0, 1</p>
  </blockquote>