[R] unique rows

dax42 Dax42 at web.de
Sat Jan 29 13:53:52 CET 2005


Dear list,

I would like to extract from a matrix all those rows, that are unique.
By unique, I don't mean the unique that is accomplished by the function 
unique(), though...

Consider the following example:
 > h
      [,1] [,2]
[1,]    4    4
[2,]    1    4
[3,]    4    1

Now unique(h) returns exactly the same - because 1 4 and 4 1 is not the 
same for that function.
What I would like to see, though, are only the first two rows (or the 
first and the third, it does not matter).

Does anybody know how to do that?
Cheers, Dax.




More information about the R-help mailing list