title: R language: Replace variables if the value can be matched in another table
body: <p>I have a sales report table (DF1)and I need to replace only a few product codes by their associated group codes</p>
  
  <pre><code>       Model        SOLD
          A             5
          B             4
          C             4
          D             3
          F             11
  </code></pre>
  
  <p>I have another table (DF2) where I have the Model# and the associated group codes</p>
  
  <pre><code>       Model        Group
          A             1
          B             1
          C             2
          D             2
  </code></pre>
  
  <p>I would like to replace the model# in DF1 by the group number if the model exist in DF2.</p>
  
  <p>The  wanted end result:</p>
  
  <pre><code>       Model        SOLD
          1             5
          1             4
          2             4
          2             3
          F             11
  </code></pre>
  
  <p>Thank you!</p>