title: How to add a column from one dataframe to a different dataframe based on an ID in R?
body: <p>I have two different data frames composed of strings (several thousands of rows). They each have a different number of entries. I am trying to find a code that will allow me to associate the content of the column &quot;characteristic&quot; in df2 into df1 (see example below) :</p>
  <p>Df1 :</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ID</th>
  <th>Information</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>11AA</td>
  <td>info1</td>
  </tr>
  <tr>
  <td>22BB</td>
  <td>info2</td>
  </tr>
  <tr>
  <td>33CC</td>
  <td>info3</td>
  </tr>
  <tr>
  <td>44DD</td>
  <td>info4</td>
  </tr>
  <tr>
  <td>11AA</td>
  <td>info1</td>
  </tr>
  <tr>
  <td>22BB</td>
  <td>info2</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Df2:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ID</th>
  <th>Characteristic</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>11AA</td>
  <td>char1</td>
  </tr>
  <tr>
  <td>22BB</td>
  <td>char2</td>
  </tr>
  <tr>
  <td>33CC</td>
  <td>char3</td>
  </tr>
  <tr>
  <td>44DD</td>
  <td>char4</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>The intended result would be :</p>
  <p>Df3:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ID</th>
  <th>Information</th>
  <th>Characteristic</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>11AA</td>
  <td>info1</td>
  <td>char1</td>
  </tr>
  <tr>
  <td>22BB</td>
  <td>info2</td>
  <td>char2</td>
  </tr>
  <tr>
  <td>33CC</td>
  <td>info3</td>
  <td>char3</td>
  </tr>
  <tr>
  <td>44DD</td>
  <td>info4</td>
  <td>char4</td>
  </tr>
  <tr>
  <td>11AA</td>
  <td>info1</td>
  <td>char1</td>
  </tr>
  <tr>
  <td>22BB</td>
  <td>info2</td>
  <td>char2</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I tried using inner_join(df1,df2, by=&quot;ID&quot;) but the resulting dataframe (df3) often has more rows than the original (df1) and I need that the resulting dataframe (df3) keeps the same structure than the original one (df1), I just need to add the extra column.</p>
  <p>Is there a built in function for this type of operation?</p>