title: Identifying unique duplicates in vector in R
body: <p>I am trying to identify duplicates based of a match of elements in two vectors. Using duplicate() provides a vector of all matches, however I would like to index which are matches with each other or not. Using the following code as an example:</p>
  
  <pre><code>x &lt;- c(1,6,4,6,4,4)             
  y &lt;- c(3,2,5,2,5,5)         
  
  frame &lt;- data.frame(x,y)        
  matches &lt;- duplicated(frame) | duplicated(frame, fromLast = TRUE)   
  matches
  [1] FALSE  TRUE  TRUE  TRUE  TRUE  TRUE
  </code></pre>
  
  <p>Ultimately, I would like to create a vector that identifies elements 2 and 4 are matches as well as 3,5,6. Any thoughts are greatly appreciated.</p>