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

Peng Yu pengyu.ut at gmail.com
Wed Dec 2 02:57:22 CET 2009


On Tue, Dec 1, 2009 at 7:46 PM, Jorge Ivan Velez
<jorgeivanvelez at gmail.com> wrote:
> Try this:
> R> apropos('any')
> R> ?anyDuplicated
> HTH,
> Jorge
>
> On Tue, Dec 1, 2009 at 8:32 PM, Peng Yu <pengyu.ut at gmail.com> wrote:
>>
>> On Tue, Dec 1, 2009 at 1:40 AM, Karl Ove Hufthammer <karl at huftis.org>
>> wrote:
>> > 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.
>>
>> I don't find anyDuplicated(). Which package is it from?

Here are what I got.

> apropos('any')
[1] "any"          "argsAnywhere" ".__C__ANY"    "getAnywhere"
> ?anyDuplicated
No documentation for 'anyDuplicated' in specified packages and libraries:
you could try 'help.search("anyDuplicated")'




More information about the R-help mailing list