Standardise a call against formal arguments

Compared to, call_standardise():

  • Always report dotted arguments as such: call(..1, ..2). In comparison, inlines literals: call("foo", 10).
  • Provides an argument enum_dots to impose enumerated names on dotted arguments. This produces call(..1 = x, ..2 = ..3) instead of call(foo = x, ..3).
  • Does not sort arguments according to the order of appearance in the function definition.
  • Standardises missing arguments as well if you specify add_missings: call(x = , y = , ).

call_standardise(call = NULL, fn = NULL, caller_env = NULL, enum_dots = FALSE, add_missings = FALSE)
Can be a call, a formula quoting a call in the right-hand side, or a frame object from which to extract the call expression. If not supplied, the calling frame is used.
The function against which to standardise the call. If not supplied, it is either retrieved from call if the latter is frame or formula (by looking up the formula's environment). Alternatively, it is lookep up in the calling frame if not supplied.
Parent frame in which to look up call the contents of .... If not supplied and call is a frame object, it is retrieved from call.
Whether to standardise the names of dotted arguments. If TRUE, this produces calls such as f(..1 = ..2) instead of f(..2). The first form is mostly intended for code analysis tools as it makes it easier to climb arguments through nested calls. The latter form (the default) is more faithful to the actual call and is ready to be evaluated.
Whether to standardise missing arguments.
  • call_standardise
Documentation reproduced from package rlang, version, License: GPL-3

Community examples

Looks like there are no examples yet.