Description Usage Arguments Details Value Examples
Pass the elipsis arguemnt to one or more functions
1 |
f |
vector containing one or more functions or function names |
... |
arguments to be passed to the functions named in |
consume |
if true, each function removes is arguments prior to the next call |
quote |
passed to |
envir |
passed to |
Each function named in f
is executed using
do.call
. The additional arguments given in "..." will be
matched against the formals of the subfunction. Each function will only be
passed arguments matching its formals
. Argument matching is
recorded and any unused arguments are returned.
If consume
is true, then each function called in order will remove
its matching arguments from those available to the next function.
The ... arguments will be evaluated prior to do.call
, so you
must quote
them if you want to avoid early evaluation.
A list of return values from each function named in f
. Each
list element will be named for the function called or the name used in
constructing the vector f
. All unused arguments will returned in the
"..." list element.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | f = function(a, b) c(a, b)
g = function(c, d) c(c, d)
h = function(...) { f(...); g(...) }
try({ h(a = 1, b = 2, c = 3, d = 4) })
do_dots(c("f", "g"), a = 1, b = 2, c = 3, d = 4, e = 5)
j = function(a, d) c(a, d)
do_dots(c("f", "j"), a = 1, b = 2, c = 3, d = 4)
try({ do_dots(c("f", "j"), a = 1, b = 2, c = 3, d = 4, consume = TRUE) })
# primitive functions use implicit ... args
do_dots("sum", rnorm(100))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.