| showMethods {methods} | R Documentation |
Show all the methods for the specified function(s)
Description
Show a summary of the methods for one or more generic functions, possibly restricted to those involving specified classes.
Usage
showMethods(f = character(), where = topenv(parent.frame()),
classes = NULL, includeDefs = FALSE, inherited = TRUE,
showEmpty, printTo = stdout())
Arguments
f |
one or more function names. If omitted, all functions will be shown that match the other arguments. |
where |
Used only when |
classes |
If argument |
includeDefs |
If |
inherited |
If |
showEmpty |
logical indicating whether methods with no defined
methods matching the other criteria should be shown at all. By
default, |
printTo |
The connection on which the printed information will be
written; by default, standard output. If |
Details
The name and package of the generic are followed by the list of signatures for which methods are currently defined, according to the criteria determined by the various arguments. Note that the package refers to the source of the generic function. Individual methods for that generic can come from other packages as well.
Value
If printTo is FALSE, the character vector that would
have been printed is returned; otherwise the value is the connection
or filename, via invisible.
References
The R package methods implements, with a few exceptions, the programming interface for classes and methods in the book Programming with Data (John M. Chambers, Springer, 1998), in particular sections 1.6, 2.7, 2.8, and chapters 7 and 8.
While the programming interface for the methods package follows
the reference, the R software is an original implementation, so
details in the reference that reflect the S4 implementation may appear
differently in R. Also, there are extensions to the programming
interface developed more recently than the reference. See
Methods and references from there.
See Also
setMethod, and GenericFunctions
for other tools involving methods;
selectMethod will show you the method dispatched for a
particular function and signature of classes for the arguments.
Examples
## Assuming the methods for plot
## are set up as in the example of help(setMethod),
## print (without definitions) the methods that involve class "track":
showMethods("plot", classes = "track")
## Not run:
Function "plot":
x = ANY, y = track
x = track, y = missing
x = track, y = ANY
## End(Not run)
not.there <- !any("package:stats4" == search())
if(not.there) library(stats4)
showMethods(class = "mle")
if(not.there) detach("package:stats4")