doCall: Wrapper for do.call

Description Usage Arguments Details Value Examples

View source: R/doCall.R

Description

Wrapper for 'do.call' with the shorthand for additional args

Usage

1
doCall(f, args, ..., quote = FALSE, envir = parent.frame(), warnDup = TRUE)

Arguments

args

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

...

Additional named arguments to be included in 'args'

quote

a logical value indicating whether to quote the arguments.

envir

an environment within which to evaluate the call. This will be most useful if what is a character string and the arguments are symbols or quoted expressions.

warnDup

logical

Details

When arguments are duplicated between 'args' and '...' preference is given to '...' (with a warning when warnDup = TRUE, the default).

Value

The result of the (evaluated) function call.

Examples

1
2
3
4
5
6
demolist <- list(a = 1:10, b = "hello")
demofunc <- function(a, b, c) list(a, b, c)
## The following errors
## do.call(demofunc, c(demolist, c = 1:2)) 
do.call(demofunc, c(demolist, list(c = 1:2)))
doCall(demofunc, demolist, c = 1:2)

daynefiler/dlfUtils documentation built on Oct. 22, 2021, 9:49 a.m.