methodDefinition | R Documentation |
Access the data inside an S4 method definition
methodFunction(f, signature, package)
methodFormals(f, signature, package)
f |
a generic function or the character-string name of one. |
signature |
the signature of classes to match to the arguments
of |
package |
|
methodFormals
: list
. Extract the sealed formal arguments.
methodFunction
: function
. Extract the sealed function.
Updated 2021-08-13.
Modified version of John Chambers' code.
help(topic = "MethodDefinition-class", package = "methods")
.
methods::selectMethod()
.
methods::setMethod()
.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.