title: how to remove unique entry and keep duplicates in R
body: <pre><code>ID     Cat1  Cat2    Cat3   Cat4
  A0001   358 11.25   37428   0
  A0001   279 14.6875 38605   0
  A0013   367 5.125   40152   1
  A0014   337 16.3125 38624   0
  A0020   367 8.875   37797   0
  A0020   339 9.625   39324   0
  </code></pre>
  
  <p>I need help learning to how remove the unique rows in my file while keeping the duplicates or triplicates. For example, output should look like below:</p>
  
  <pre><code>ID     Cat1  Cat2    Cat3   Cat4
  A0001   358 11.25   37428   0
  A0001   279 14.6875 38605   0
  A0020   367 8.875   37797   0
  A0020   339 9.625   39324   0
  </code></pre>
  
  <p>If you can give me advice how to approach this problem, much appreciated.</p>
  
  <p>Thanks for everyone's suggestions. I wanted to calculate the difference in value in the different Categories (i.e. Cat2, Cat 3) between the repeated measures (by unique ID). Would appreciate any suggestions. </p>