See ?duplicated. But really I don't see anything wrong with your approach. -Ista
On Mon, Nov 30, 2009 at 10:42 PM, Peng Yu <pengyu...@gmail.com> wrote: > 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. > > ______________________________________________ > 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. > -- Ista Zahn Graduate student University of Rochester Department of Clinical and Social Psychology http://yourpsyche.org ______________________________________________ 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.