I have data.frame with multiple columns (17). Column 2 has several rows with the same value, I want to save only one of these rows, in particular the one that has the maximum value in column 17.
For instance:
AB 'a' 1 'a' 2 'a' 3 'b' 5 'b' 200 Would return AB 'a' 3 'b' 200
(plus the rest of the columns)
So far I have used a unique function, but I think that it accidentally saves one or saves only the first that appears.
** UPDATE ** Real data has 376,000 rows. I tried data.table and offer suggestions, but they take forever. Any idea which is most effective?
biojl source share