ignore_unused_args: do.call but without an error for unused arguments

ignore_unused_argsR Documentation

do.call but without an error for unused arguments

Description

do.call but without an error for unused arguments

Usage

ignore_unused_args(what, args)

Arguments

what

either a function or a non-empty character string naming the function to be called.

args

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

Value

The result of the (evaluated) function call.

Examples

# works:
DescrTab2:::ignore_unused_args(
  chisq.test,
  list(x = factor(c(1, 0, 1, 1, 1, 0)), y = factor(c(0, 1, 1, 0, 1, 0)), abc = 3)
)

# would produce error:
# do.call(chisq.test, list(x=factor(c(1,0,1,1,1,0)), y=factor(c(0,1,1,0,1,0)), abc=3 ) )

DescrTab2 documentation built on Sept. 6, 2022, 9:05 a.m.