Unpacking argument lists for ellipsis in R

后端 未结 3 516
暗喜
暗喜 2020-12-08 04:09

I am confused by the use of the ellipsis (...) in some functions, i.e. how to pass an object containing the arguments as a single argument.

In Python it

3条回答
  •  死守一世寂寞
    2020-12-08 04:37

    The syntax is not as beautiful, but this does the trick:

    do.call(file.path,as.list(c("/foo/bar",args)))
    

    do.call takes two arguments: a function and a list of arguments to call that function with.

提交回复
热议问题