[R] Removing row with smallest value, for a given factor

- - sqidufbkqsdjvbqdskuvgc at yahoo.fr
Sat Apr 23 15:05:21 CEST 2011


I have a table.
First column is a date, second column is an index and other columns contains some other values.
I want to remove, for each date, the row with the smallest index (it is not necessarily 1).

ex: in the following table, I want to remove row 1 (2013-05-12 with index 2) and row 8 (2013-05-13 with index 1)

           day index values
1    2013-05-12    2  xxxx
2    2013-05-12    3  xxxx
3    2013-05-12    4  xxxx
4    2013-05-12    5  xxxx
5    2013-05-12    6  xxxx
6    2013-05-12    7  xxxx
7    2013-05-12    8  xxxx
8    2013-05-13    1  xxxx
9    2013-05-13    3  xxxx
10   2013-05-13    4  xxxx
11   2013-05-13    5  xxxx
12   2013-05-13    6  xxxx
13   2013-05-13    7  xxxx
14   2013-05-13    8  xxxx
15   2013-05-13    9  xxxx
16   2013-05-13   10  xxxx
17   2013-05-13   12  xxxx


Thank you for your help



More information about the R-help mailing list