Skip to content
Prev 391001 / 398506 Next

obtain names & values of all arguments passed to a function including args passed using the "three dots" ellipsis ( ...) parameter, for use in do.call

Sorry for the prior post, I think I found a better way. I can just use
 as.list( match.call()[-1] )

 Here's an example:

fn_return_args_in <- function(x = NULL, y, ...){ return( as.list(
match.call() [-1] ) ) }
do.call(what = fn_return_args_in, args = list(x=1, y=2, zebra = 44,
dog = 'snoopy') )
do.call(what = fn_return_args_in, args = list(y=2, zebra = 44, dog = 'snoopy') )
On Sat, Mar 12, 2022 at 1:29 PM Kelly Thompson <kt1572757 at gmail.com> wrote: