Perhaps a bug of using the three-dot argument in R 3.6.3

45 views Asked by At

It seems to me a bug for using ... to pass function arugments in R 3.6.3. Specifically, the named arguments will try to partial match the arguments in ..., not exact match. Here's an example:

func1 <- function(varname, ...)
{
  cat(varname, "\n")
}
func1(0, foo = 3)
func1(0, var = 2, foo = 3)
func1(0, var = 1, varn = 2, foo = 3)

The outputs in R 3.6.3 will be:

0
2
Error in func1(0, var = 1, varn = 2, foo = 3) : 
  formal argument "varname" matched by multiple actual arguments
0

There are 0 answers