[R] Is there a function to test if all the elements in a vector are unique

Karl Ove Hufthammer karl at huftis.org
Tue Dec 1 08:40:02 CET 2009


On Tue, 1 Dec 2009 14:48:04 +1100 Remko Duursma <remkoduursma at gmail.com> 
wrote:
> any(duplicated(c(1,2,2)))

or
anyDuplicated(c(1,2,2))
which is slightly more efficient.

-- 
Karl Ove Hufthammer




More information about the R-help mailing list