The R language has a nifty feature for defining functions that can take a variable number of arguments. For example, the function data.frame
takes any number of
You gave half the answer already. Consider
R> my_ellipsis_function <- function(...) {
+ input_list <- as.list(substitute(list(...)))
+ }
R> print(my_ellipsis_function(a=1:10, b=2:20))
[[1]]
list
$a
1:10
$b
11:20
R>
So this took two arguments a
and b
from the call and converted it to a list. Wasn't that what you asked for?