View source: R/standardizeCall.R
standardizeCall | R Documentation |
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 = getOption(x = "verbose", default = FALSE)
)
which |
the frame number if non-negative, the number of frames to go back if negative. |
defaults |
|
expandDots |
|
return |
|
verbose |
|
call
: Matched call.
list
: Verbose list that includes additional information about how the
call was standardized. Recommended for debugging purposes only.
Updated 2020-01-09.
match.call()
.
sys.call()
.
sys.parent()
.
pryr::standardise_call()
.
stackoverflow::match.call.defaults()
.
aaa <- "AAA"
bbb <- "BBB"
## Standard function.
testing <- function(a, b) {
standardizeCall()
}
testing(aaa, bbb)
## Inside S4 method.
setGeneric(
name = "testing",
def = function(a, ...) {
standardGeneric("testing")
}
)
setMethod(
f = "testing",
signature = signature(a = "character"),
definition = function(a, b, ...) {
standardizeCall()
}
)
testing(aaa, bbb)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.