title: Merging two data frames horizontally by ID and keep only matches from the second one
body: <p>I have two data frames which I want to merge horizontally:</p>
  
  <pre><code>dat_a
  
    a b c
  1 1 1 A
  2 2 1 A
  3 3 1 B
  4 4 1 B
  
  
  dat_b
  
    a b c
  1 3 1 C
  2 3 1 C
  3 3 1 D
  4 4 1 D
  </code></pre>
  
  <p>I want to only keep those rows from <code>dat_a</code> which have a match in <code>dat_b</code> for columns <code>a</code> and <code>b</code>.</p>
  
  <p>So the final result should look like this:</p>
  
  <pre><code>dat_c
     a b c
  1 3 1 B
  2 4 1 B
  3 3 1 C
  4 3 1 C
  5 3 1 D
  6 4 1 D
  </code></pre>