Description Usage Arguments Details Value
View source: R/update_formals.R
Update the formals of a function
1 | update_formals(.fun, ..., .list = FALSE)
|
.fun |
The targeted function whose formals should be updated. Warning: If the function belongs to the same environment, then the update will be permanent, whereas a local copy (with adjusted formals) will be created otherwise. |
... |
The arguments to be used when updating the formals of
|
.list |
A logical value, default |
The dotsMethods
, i.e. ...
, allows
inheritance of arguments from a parent function to its
children. But if several children require different arguments
passed to them, some minor problems can occur (unless all of
the children have ...
as an argument in order to work as
a sink for superfluous arguments). This function attempts to
avoid those problems (for functions without dotsMethods
by comparing the formals of the targeted child-function with
the content captured in the dotsMethods
, whereupon it
updates any common components and ignores the part of
...
that has no relevance.
The result of this function is that the formals of
.fun
is updated in the calling environment. If the
targeted function is defined outside of this environment, a
local copy will be created. This might trigger some "bad"
behaviour, and it might be safer to use a construction based on
crate_call
instead.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.