title: Match function duplicate values
body: <p>I was wondering if there is a function in R will help me deal with the problem match function will create if two datasets have duplicating values?</p>
  
  <p>For example,</p>
  
  <pre><code>x=c(1,2,2,3,3)
  y=c(2,2,3)
  </code></pre>
  
  <p>and I want to keep all the 2,2,3,3 in X but only list 2,2,3 in Y and I still want them to be arranged in order.</p>
  
  <p>Is there a way to do it?</p>