Envision
examplefn <- function(x = NULL, ...){str(x)}
I'm trying to get this function to honor the implicit x = NULL
. Consider the following:
For a call using both x
and ...
this results as expected in:
> examplefn(1,2)
num 1
If using an explicit x = NULL
, the behavior also is as expected:
> examplefn(x = NULL,2)
NULL
However, when attempting (and expecting the usage of x = NULL
from the function definition, I get:
> examplefn(2)
num 2
Implying, that the call is evaluated by argument order, disregarding the x = NULL
definition.
How can the latter be prevented?