0

I want to do something to the effect of

args = list(arg1, arg2, arg3, arg4, arg5)

output = function(args)

which would be the equivalent of

output = function(arg1, arg2, arg3, arg4, arg5)

There is a way to do this in MATLAB, you could type

args = {arg1, arg2, arg3, arg4, arg5

output = function(args{:})

which is equivalent to output = function(arg1, arg2, arg3, arg4, arg5).

But is there a nice way to do this in R?

  • If you want to pass a list of parameters with base R, you must use `do.call` (See duplicate for details) – MrFlick Jun 17 '21 at 18:15

0 Answers0