title: How do I add column values based on matching IDs in R?
body: <p>I have two data frames:</p>
  
  <p>A:</p>
  
  <pre><code>ID    Var1    Var2    Var3
  1       0       3       4
  2       1       5       0
  3       1       6       7
  </code></pre>
  
  <p>B:</p>
  
  <pre><code>ID    Var1    Var2    Var3    
  1       2       4       2
  2       2       1       1
  3       0       2       1
  4       1       0       3
  </code></pre>
  
  <p>I want to add the columns from A and B based on matching ID's to get data frame C, and keep row 4 from B (even though it does not have a matching ID from A):</p>
  
  <pre><code>ID    Var1    Var2    Var3
  1       2       7       6
  2       3       6       1
  3       1       8       8
  4       1       0       3
  </code></pre>