existsMethod
Search for a Method for a Generic Function
Description
Checks if a generic function has a method whose signature exactly
matches a given signature.
Usage
existsMethod(f, signature = character(), where = topenv(parent.frame()))
Arguments
f |
the name of the generic function.
|
signature |
the signature of the method to search for.
|
where |
the package environment to search.
Supply either an environment or a number representing
its position in the search path.
If where is missing, all attached packages are searched.
|
Value
returns a logical value. It returns TRUE if generic function f has a
method that matches the signature sig exactly. Otherwise, it returns FALSE.
See Also
Examples
setGeneric("setG", function(x)standardGeneric("setG"))
setMethod("setG", "numeric", function(x) x^2)
existsMethod("setG", "numeric") # TRUE
existsMethod("setG", "integer") # FALSE