title: Randomly remove duplicated rows using dplyr()
body: <p>As a follow-up question to this one: <a href="https://stackoverflow.com/questions/22959635/remove-duplicated-rows-using-dplyr">Remove duplicated rows using dplyr</a>, I have the following: </p>
  
  <p><em>How do you randomly remove duplicated rows using dplyr() (among others)?</em></p>
  
  <p>My command now is:</p>
  
  <pre><code>data.uniques &lt;- distinct(data, KEYVARIABLE, .keep_all = TRUE)
  </code></pre>
  
  <p>But it returns the first occurrence of the KEYVARIABLE. I want that behaviour to be random: so anywhere between <code>1</code> and <code>n</code> occurrences of that KEYVARIABLE.</p>
  
  <p>For instance:</p>
  
  <pre><code>KEYVARIABLE BMI
  1 24.2
  2 25.3
  2 23.2
  3 18.9
  4 19
  4 20.1
  5 23.0
  </code></pre>
  
  <p>Currently my command returns:</p>
  
  <pre><code>KEYVARIABLE BMI
  1 24.2
  2 25.3
  3 18.9
  4 19
  5 23.0
  </code></pre>
  
  <p>I want it to randomly return one of the <code>n</code> duplicated rows, for instance:</p>
  
  <pre><code>KEYVARIABLE BMI
  1 24.2
  2 23.2
  3 18.9
  4 19
  5 23.0
  </code></pre>