This function adds matching support for S4 methods with formals that aren't identical to the generic, and use a nested .local call.

standardizeCall(which = sys.parent(n = 1L), defaults = TRUE,
  expandDots = TRUE, return = c("call", "list"), verbose = FALSE)

Arguments

which

the frame number if non-negative, the number of frames to go back if negative.

defaults

logical(1). Include default arguments in the call.

expandDots

logical(1). Should arguments matching ... in the call be included or left as a ... argument?

return

character(1). Return type. Uses match.arg() internally and defaults to the first argument in the character vector.

verbose

logical(1). Run the function with verbose output.

Value

  • call: Matched call.

  • list: Verbose list that includes additional information about how the call was standardized. Recommended for debugging purposes only.

Note

Updated 2019-08-08.

See also

Examples

aaa <- "AAA" bbb <- "BBB" ## Standard function. testing <- function(a, b) { standardizeCall() } testing(aaa, bbb)
#> testing(a = aaa, b = bbb)
## Inside S4 method. setGeneric( name = "testing", def = function(a, b, ...) { standardGeneric("testing") } )
#> [1] "testing"
setMethod( f = "testing", signature = signature("character"), definition = function(a, b, ...) { standardizeCall() } ) testing(aaa, bbb)
#> testing(a = aaa, b = bbb)