Match arguments to do.call

matchArgsToDoCall(args = NULL, removeFormals = NULL,
  which = sys.parent(n = 1L), verbose = getOption("goalie.traceback",
  FALSE))

Arguments

args

a list of arguments to the function call. The names attribute of args gives the argument names.

removeFormals

character. Names of formal arguments to remove from args list.

which

the frame number if non-negative, the number of frames to go back if negative.

verbose

logical(1). Run the function with verbose output.

Value

list. Arguments to pass to do.call().

Note

Updated 2019-07-29.

See also

Examples

## Match the arguments in call. fun <- function(object, xxx, ...) { args <- matchArgsToDoCall( args = list(object = object, collapse = " "), removeFormals = "xxx" ) args } fun(c("hello", "world"))
#> $object #> [1] "hello" "world" #> #> $collapse #> [1] " " #>
## Pass the arguments to `do.call()`. fun <- function(object, xxx, ...) { do.call( what = paste, args = matchArgsToDoCall( args = list(collapse = " "), removeFormals = "xxx" ) ) } fun(c("hello", "world"))
#> [1] "hello world"