methodDefinition: Access the data inside an S4 method definition

methodDefinitionR Documentation

Access the data inside an S4 method definition

Description

Access the data inside an S4 method definition

Usage

methodFunction(f, signature, package)

methodFormals(f, signature, package)

Arguments

f

a generic function or the character-string name of one.

signature

the signature of classes to match to the arguments of f. See the details below.

package

character(1). Package name.

Value

  • methodFormals: list. Extract the sealed formal arguments.

  • methodFunction: function. Extract the sealed function.

Note

Updated 2021-08-13.

See Also

  • Modified version of John Chambers' code.

  • help(topic = "MethodDefinition-class", package = "methods").

  • methods::selectMethod().

  • methods::setMethod().

Examples

## Function ====
x <- methodFunction(
    f = "show",
    signature = "ANY",
    package = "methods"
)
class(x)
body(x)

## Formals ====
x <- methodFormals(
    f = "show",
    signature = "ANY",
    package = "methods"
)
class(x)
print(x)

acidgenomics/AcidBase documentation built on Jan. 28, 2024, 2:59 a.m.