Match supplied arguments to function definitionSource:
call_match() is like
match.call() with these differences:
It supports matching missing argument to their defaults in the function definition.
It requires you to be a little more specific in some cases. Either all arguments are inferred from the call stack or none of them are (see the Inference section).
call_match( call = NULL, fn = NULL, ..., defaults = FALSE, dots_env = NULL, dots_expand = TRUE )
A call. The arguments will be matched to
A function definition to match arguments to.
These dots must be empty.
Whether to match missing arguments to their defaults.
An execution environment where to find dots. If supplied and dots exist in this environment, and if
..., the forwarded dots are matched to numbered dots (e.g.
..2, etc). By default this is set to the empty environment which means that
...expands to nothing.
FALSE, arguments passed through
...will not be spliced into
call. Instead, they are gathered in a pairlist and assigned to an argument named
.... Gathering dots arguments is useful if you need to separate them from the other named arguments.
Note that the resulting call is not meant to be evaluated since R does not support passing dots through a named argument, even if named
call is not supplied, it is inferred from the call stack
fnare inferred from the calling environment:
dots_envis inferred from the caller of the calling environment:
call is supplied, then you must supply
fn as well. Also
dots_env as it is set to the empty environment
when not inferred.