title: dplyr unique rows sample_n
body: <p>I am trying to get random samples based on group for a relatively large data frame.  I need to get unique results for each group member only - I can't have results duplicate for an individual member or overall. </p>
  
  <p>I have used this code successfully for small samples:</p>
  
  <pre><code>    processors2 &lt;- processors%&gt;%filter(str_detect(Person.Who.Changed.Object, "A0")) %&gt;% 
        group_by(User)%&gt;% sample_n(., 2)
  </code></pre>
  
  <p>However, if I use the below similar code, I get multiple duplicates both within  groups and overall (i.e. member 1 and member 3 get the same row of data, and member 1 gets 2 of a different row all to itself).</p>
  
  <pre><code>claimallocator2 &lt;- claimallocator%&gt;%
    group_by(User)%&gt;% sample_n(80, weight = Claim.Amt)
  </code></pre>
  
  <p>Additionally, it makes no difference if I add replace = FALSE.  I am still getting duplicates.</p>
  
  <p>The expected output (obviously on a drastically smaller scale):</p>
  
  <pre><code>User    Warranty.Claim  Claim.amt
  User 1  1   500
  User 1  2   1000
  User 1  3   1500
  User 1  4   2000
  User 1  5   2500
  User 2  6   3000
  User 2  7   3500
  User 2  8   4000
  User 2  9   4500
  User 2  10  5000
  User 2  11  5500
  User 2  12  6000
  User 3  13  6500
  User 3  14  7000
  User 3  15  7500
  User 3  16  8000
  User 3  17  8500
  User 3  18  9000
  User 3  19  9500
  User 3  20  10000
  User 3  21  10500
  User 3  22  11000
  </code></pre>
  
  <p>What I am actually getting:</p>
  
  <pre><code>    User    Warranty.Claim  Claim.amt
      User 1  1   500
      User 1  1   500
      User 1  3   1500
      User 1  4   2000
      User 1  5   2500
      User 2  6   3000
      User 2  7   3500
      User 2  8   4000
      User 2  9   4500
      User 2  10  5000
      User 2  11  5500
      User 2  12  6000
      User 3  13  6500
      User 3  14  7000
      User 3  15  7500
      User 3  16  8000
      User 3  17  8500
      User 3  18  9000
      User 3  19  9500
      User 3  8   4000
      User 3  21  10500
      User 3  22  11000
  </code></pre>