title: r: Add lowest value matching criteria and a corresponding observation to new columns
body: <p>My data frame looks like this</p>
  
  <pre><code>ID       score obs
  1        0     a
  1        11    b
  1        12    c
  2        1     d
  2        11    e
  2        2     f
  3        0     g
  3        0     h
  3        0     i
  </code></pre>
  
  <p>I need to make sure each person has a score above 10. If a person has no score above 10, all rows the personID shows up need to be deleted. The lowest score above 10 needs to go to a new column and the corresponding obs needs to go into a new column too (*note: there is not a situation where a person has two of the same score). Result should look like this:</p>
  
  <pre><code>ID score obs nScore nObs
  1  0     a   11     b
  1  11    b   11     b
  1  12    c   11     b
  2  1     d   11     e
  2  11    e   11     e
  2  2     f   11     e
  </code></pre>
  
  <p>Ideally, every repeated personID should also be deleted so that the lowest score is kept in the score column. The result looks like this:</p>
  
  <pre><code>ID score obs nScore nObs
  1  0     a   11     b
  2  1     d   11     e
  </code></pre>
  
  <p>I would be happy if you could help me get to the first result. If you could help me get the second result, I don't require that you show me how to get to the first result before getting to the second result (like if you got to the second result all in one step).</p>