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?