[r] Extract the maximum value within each group in a dataframe