[Rd] length of `...`

Dénes Tóth toth@dene@ @ending from kogentum@hu
Thu May 3 16:29:28 CEST 2018


In some cases the number of arguments passed as ... must be determined 
inside a function, without evaluating the arguments themselves. I use 
the following construct:

dotlength <- function(...) length(substitute(expression(...))) - 1L

# Usage (returns 3):
dotlength(1, 4, something = undefined)

How can I define a method for length() which could be called directly on 
`...`? Or is it an intention to extend the base length() function to 
accept ellipses?


More information about the R-devel mailing list