Hi

r-help-boun...@r-project.org napsal dne 01.12.2009 04:42:31:

> length(unique(c(1,2,2)))==length(c(1,2,2))
> 
> I use the above test to test if all the elements in a vector are
> unique. But I'm wondering if there is a convenient function to do so
> in R library.

maybe
any(duplicated(c(1,2,2)))

Regards
Petr

> 
> ______________________________________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to