All:

I did not want to bother R folks for an R Bugzilla account, so I'll just
note what appears to be a documentation bug here

In R version 4.0.3, ?anyDuplicated  says:
"anyDuplicated(.) is a “generalized” more efficient shortcut for
any(duplicated(.)).

However, anyDuplicated returns an integer and any(duplicated)  -- that is
any() -- returns a logical.  I was bitten by this by a function expecting a
logical from anyDuplicated.

I realize that there are scare quotes around "generalized", which would
indicate that anyDuplicated and any(duplicated(.)) aren't identical.
However, I believe that the line above (especially 'shortcut') leads one to
expect that both return a logical. A simple addition such as: "Note,
however, that any() returns a logical and anyDuplicated's  returns an
integer' would avoid the confusion.

Best to all,
Bert

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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