title: Deleting rows in dataset
body: <p>I have some corrupted data in my Panel Dataset - for some groups (gid) and time (t) I have more than one observation. All observations have the variable (quantity) - I want R to exclude the observation with the lowest number in quantity. </p>
  
  <p>My current solution has been this, but with this I do not control which of two identical observations that R will exclude...</p>
  
  <pre><code>IMS &lt;- subset(IMS, !duplicated(data.frame(t,gid)))
  </code></pre>
  
  <p>Example:</p>
  
  <pre><code>Product    Strength    Pack_size    y        t    Quantity    gid
  Ibumetin    600MG        100      5.9183     1      10226    2613
  Ibumetin    600MG        100      25.3500    1        100    2613
  </code></pre>
  
  <p>In the example the observation to be excluded is the one with 100 in quantity, since 10226>100.</p>
  
  <p>I will be gratefull for the help you can provide,</p>
  
  <p>Henrik</p>