title: R: Counting the number of matches between multiple data frames
body: <p>I want to find the number of matches based on ID of unique matches within multiple data.frames</p>
  
  <p>Data looks like this:</p>
  
  <pre><code>df1: KeyID
         x
         x
         y
         y
         z
  
  df2: KeyID
         x
         x
         x
         z
         z
  
  df3: KeyID
         x
         y
         y
         z
  </code></pre>
  
  <p>I want to count the number of unique matches between data frames.</p>
  
  <p>output would look like this:
   2</p>
  
  <p>Since x and z are the only matches between the two sets. </p>
  
  <p>I have done this but want to know if there is a faster way:</p>
  
  <pre><code>df1.2 &lt;- df2[df2$KeyID %in% df1$KeyID,]
  length(unique(df1.2$KeyID))
  </code></pre>
  
  <p>Any thoughts?</p>