Skip to content
Prev 312494 / 398506 Next

For loop

You could use the duplicated function maybe:

 mtest
     id time value
[1,]  1    3     1
[2,]  1    3     2
[3,]  1    2     3
[4,]  1    1     4
[5,]  2    1     5
[6,]  2    3     6
[7,]  2    3     7
[8,]  2    3     8

duplicated(mtest[,1:2])
[1] FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE  TRUE

mtest[!duplicated(mtest[,1:2]),]
     id time value
[1,]  1    3     1
[2,]  1    2     3
[3,]  1    1     4
[4,]  2    1     5
[5,]  2    3     6
On 30.11.2012, at 17:15, Jessica Streicher wrote: