Я в итоге придумал следующее:
myfunct <- function(...)
{
my_dots <- match.call(expand.dots = FALSE)[['...']]
no_dots <- is.null(my_dots)
# Process the dots
if(!no_dots)
{
my_dots <- lapply(my_dots, eval)
}
# Exemplary return
return(my_dots)
}
Это дает:
> myfunct(1)
[[1]]
[1] 1
> myfunct(NULL)
[[1]]
NULL
> myfunct()
NULL
> myfunct(1, NULL, 'A')
[[1]]
[1] 1
[[2]]
NULL
[[3]]
[1] "A"