title: To pass the row number to another column
body: <p>I have a dataframe.</p>
  
  <p>I need to find a minimum value in the 1st column for each value of the 2nd column. But I should return the value in the 3rd column from the same row as the minimum found in the 1st column.</p>
  
  <p>The first part seems is solved by <code>tapply(1,2, min)</code></p>
  
  <p>But how to pass the same row to the 3rd column?</p>
  
  <p>The more complicated task is when the minimum is not unique in the 1st column. Then I need to choose the first name (out of several) alphabetically and again to find the corresponding value from the same row from the 3rd column.</p>