title: Delete Duplicates when Merging DF
body: <p>I know, I know.... Another merging Df question, please hear me out as I have searched SO for an answer on this but none has come. </p>
  
  <p>I am merging two Df's, one smaller than the other, and doing a left merge, to match up the longer DF to the smaller DF. </p>
  
  <p>This works well except for one issue, rows get added to the left (smaller) df when the right(longer) df has duplicates. </p>
  
  <p>An Example:</p>
  
  <pre><code>Row&lt;-c("a","b","c","d","e")
  Data&lt;-(1:5)
  df1&lt;-data.frame(Row,Data)
  
  Row2&lt;-c("a","b","b","c","d","e","f","g","h")
  Data2&lt;-(1:9)
  df2&lt;-data.frame(Row2,Data2)
  
  names(df2)&lt;-c("Row","Data2")
  
  DATA&lt;-merge(x = df1, y = df2, by = "Row", all.x = TRUE)
  
  &gt;DATA
    Row Data Data2
  1   a    1     1
  2   b    2     2
  3   b    2     3
  4   c    3     4
  5   d    4     5
  6   e    5     6
  </code></pre>
  
  <p>See the extra "b" row?, that is what I want to get rid of, I want to keep the left DF, but very strictly, as in if there are 5 rows in DF1, when merged I want there to only be 5 rows. </p>
  
  <p>Like this...</p>
  
  <pre><code>  Row Data Data2
  1   a    1     1
  2   b    2     2
  3   c    3     4
  4   d    4     5
  5   e    5     6
  </code></pre>
  
  <p>Where it only takes the first match and moves on.</p>
  
  <p>I realize the merge function is only doing its job here, so is there another way to do this to get my expected result? OR is there a post-merge modification that should be done instead. </p>
  
  <p>Thank you for your help and time. </p>
  
  <p>Research:
  <a href="https://stackoverflow.com/questions/1299871/how-to-join-merge-data-frames-inner-outer-left-right">How to join (merge) data frames (inner, outer, left, right)?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/7655832/deleting-duplicates">deleting duplicates</a></p>
  
  <p><a href="https://stackoverflow.com/questions/22225409/merging-two-data-frames-with-different-sizes-and-missing-values">Merging two data frames with different sizes and missing values</a></p>