Description Usage Arguments Details Value
Based on arguments delivered by the dotsMethods
, i.e.
...
, or by a list or by an environment, this function will
create a call for the specified function.
1 | create_call(.cc_fun, ..., .cc_list = FALSE, .cc_ignore = NULL)
|
.cc_fun |
The targeted function, either given directly or as a name or character. |
... |
|
.cc_list |
Logic value , default |
.cc_ignore |
Character vector, default value |
A call can simplify code at one point of a function at the
cost of including some "ugly" code somewhere else (in
particular if it is constructed from scratch). The function
do.call
will add everything from the list given to
argument args
to the function, and the evaluate it.
Unless the targeted function use the dotsMethods
,
i.e. ...
, this requires that the list of arguments must
be fine-tuned to the function (or else an error pointing out
some unused arguments will pop-up). An approach using
as.call
might be used, but once again everything will be
added as arguments, which implies that the resulting call must
be adjusted before evaluation. The present function doesn't
add any superfluous arguments to the targeted function, and
thus simplifies the task of creating and using calls when
programming, which often can make the code much leaner.
The result of this function is a call based on .cc_fun
and relevant arguments. Warning: The present incarnation of
the code does not test that all mandatory arguments are
included, so it's no guarantee that a call created by a nitwit
will execute.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.