title: match two data.frames based on multiple columns
body: <p>My head stands still at the moment. I would like to match/extract data from a larger data.frame (df) based on the columns in a smaller data.frame (mdf). What I'm getting stuck on is the fact that I want to match multiple columns (two in this case). I have tried different approaches using e.g. <code>merge</code>, <code>which</code>, <code>match</code> <code>%in%</code> but non have succeeded. </p>
  
  <pre><code># Dummy example
  
  # Large df
  df &lt;- mtcars[1:6,1:3]
  df$car_1 &lt;- rownames(df)
  df$car_2 &lt;- rownames(tail(mtcars))
  
  # df to match
  mdf &lt;- df[c("car_1","car_2")][3:6,]
  
  rownames(df) &lt;- NULL
  rownames(mdf) &lt;- NULL
  </code></pre>
  
  <p>The desired output would look something like</p>
  
  <pre><code> mpg cyl disp             car_1          car_2
  22.8   4  108        Datsun 710 Ford Pantera L
  21.4   6  258    Hornet 4 Drive   Ferrari Dino  
  18.7   8  360 Hornet Sportabout  Maserati Bora
  18.1   6  225           Valiant     Volvo 142E
  </code></pre>
  
  <p>This feels like it should be very straight forward.</p>
  
  <p>Any pointer would be highly appreciated, thanks!</p>