match_formals: Match arguments sent to current function to arguments found...

Description Usage Arguments Examples

View source: R/match_formals_function.R

Description

Match arguments sent to current function to arguments found in separtae function, and return as list.

Usage

1
2
3
4
match_formals(
  fun = as.character(do.call("match.call", args = list(), envir = parent.frame())[1]),
  ...
)

Arguments

fun

Function whose arguments should be matched

...

named arguments that should override or supplement those provided to current function.

Examples

1
2
3
fun1 <- function(a, b) print(paste(a, b, sep = ", "))
fun2 <- function(a, c = 2, d) do.call(fun1, match_formals(fun1, b = c))
fun2(a = "a", d = "d")

intelligentaccident/xreg documentation built on Jan. 17, 2021, 7:38 a.m.