handle.controls: Handle standard control.*() function semantics.

View source: R/control.utilities.R

handle.controlsR Documentation

Handle standard ⁠control.*()⁠ function semantics.

Description

This function takes the arguments of its caller (whose name should be passed explicitly), plus any ... arguments and produces a control list based on the standard semantics of ⁠control.*()⁠ functions, including handling deprecated arguments, identifying undefined arguments, and handling arguments that should be passed through match.arg().

Usage

handle.controls(myname, ...)

Arguments

myname

the name of the calling function.

...

the ... argument of the control function, if present.

Details

The function behaves based on the information it acquires from the calling function. Specifically,

  • The values of formal arguments (except ..., if present) are taken from the environment of the calling function and stored in the list.

  • If the calling function has a ... argument and defines an old.controls variable in its environment, then it remaps the names in ... to their new names based on old.controls. In addition, if the value is a list with two elements, action and message, the standard deprecation message will have message appended to it and then be called with action().

  • If the calling function has a match.arg.pars in its environment, the arguments in that list are processed through match.arg().

Value

a list with formal arguments of the calling function.


statnet.common documentation built on May 31, 2023, 6:31 p.m.