Create an ellipsis (...) from list

r

Solution

You want `do.call`, which can pass the content of a list to a functions `...` argument:

do.call(function(...) print(switch('a', ...)), mylist)

Problem

Is it possible to create a ellipsis (...) from a list? The idea is to be able to do something like: ``` mylist <- list(a=1,b=2,c=3) myellipsis <- create_ellipsis(mylist) print(switch('a', myellipsis)) # output 1 ```

Original source

Related problems