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), return = c("call", "list"),
  verbose = FALSE)

Arguments

which

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

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 messages? It is only recommended to enable this when debugging.

Value

  • call: call. Matched call.

  • list: list. Verbose list that includes additional information about how the call was standardized.

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)