standardizeCall: Standardize call

Description Usage Arguments Value Note See Also Examples

View source: R/standardizeCall.R

Description

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

Usage

1
2
3
4
5
6
7
standardizeCall(
  which = sys.parent(n = 1L),
  defaults = TRUE,
  expandDots = TRUE,
  return = c("call", "list"),
  verbose = getOption("verbose", default = 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

Note

Updated 2020-01-09.

See Also

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
aaa <- "AAA"
bbb <- "BBB"

## Standard function.
testing <- function(a, b) {
    standardizeCall()
}
testing(aaa, bbb)

## Inside S4 method.
setGeneric(
    name = "testing",
    def = function(a, b, ...) {
        standardGeneric("testing")
    }
)

setMethod(
    f = "testing",
    signature = signature("character"),
    definition = function(a, b, ...) {
        standardizeCall()
    }
)
testing(aaa, bbb)

acidgenomics/AcidBase documentation built on Sept. 10, 2021, 1:27 a.m.