[R] Having trouble understanding the sapply/vapply documentation and behaviour of USE.NAMES

Rolf Turner r@turner @end|ng |rom @uck|@nd@@c@nz
Sun Apr 12 03:04:48 CEST 2020

On 12/04/20 6:09 am, Martin Maechler wrote:

>>>>>> Rolf Turner
>>>>>>      on Fri, 10 Apr 2020 12:23:49 +1200 writes:


>      > IMHO there is an error in the documentation here.  Clearly
>      > USE.NAMES has a different impact on vapply() than it has
>      > on sapply() and the documentation does not indicate this,
>      > in fact quite the opposite.
> Strictly speaking, that is not true; there is *NO* error:
> The documentation never explicitly says what happens with USE.NAMES=FALSE,
> whereas it clearly and correctly specifies the effect of  USE.NAMES=TRUE,
> and everything it says is correct (and as mentioned initially,
> it notably indirectly specifies that sapply(*, USE.NAMES=FALSE)
> would *not* remove existing names.


This reminds me slightly of fortunes::fortune(313). :-)



Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

More information about the R-help mailing list