[Rd] length of `...`

Hadley Wickham h@wickh@m @ending from gm@il@com
Thu May 3 17:39:02 CEST 2018


On Thu, May 3, 2018 at 8:28 AM, Hadley Wickham <h.wickham at gmail.com> wrote:
> On Thu, May 3, 2018 at 8:00 AM, Gabe Becker <becker.gabe at gene.com> wrote:
>> As of 3.5.0 the ...length() function does exactly what you are asking for.
>> Before that, I don't know of an easy way to get the length without
>> evaluation via R code. There may be one I'm not thinking of though, I
>> haven't needed to do this myself.
>
> dotlength <- function(...) length(nargs())
>
> ?

Oops, I got a bit overzealous there: I mean

dotlength <- function(...) nargs()

(This is subtly different from calling nargs() directly as it will
only count the elements in ...)

Hadley

-- 
http://hadley.nz




More information about the R-devel mailing list