Skip to content
Back to formatted view

Raw Message

Message-ID: <CAGxFJbT19DZmGDo4RAbNyQ=TRpsLeCO5Uep8ydi3mc9ai0GGdg@mail.gmail.com>
Date: 2020-12-06T16:23:44Z
From: Bert Gunter
Subject: Small R documentation bug in ?anyDuplicated

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]]