Open lionel- opened 3 years ago
This is a limitation of R.
tilde <- function(x, y) list(substitute(x), substitute(y))
tilde(1, ...)
#> Error: '...' used in an incorrect context
ignore <- function(x, y) NULL
ignore(1, ...)
#> Error: '...' used in an incorrect context
The argument application routine of the interpreter checks that the calling environment has dots: https://github.com/wch/r-source/blob/2ab3b85b/src/main/eval.c#L3203-L3204 Only SPECIALSXP
functions like ~
can be supplied ...
without this check.
One way forward is #1145.
I just stumbled across this in a {shiny} / {data.table} context. Thanks for providing the workaround.
Causes trouble with data.table: https://github.com/rstudio/shiny/issues/3303 and https://github.com/Rdatatable/data.table/issues/4913