showMethods {methods} | R Documentation |
Show a summary of the methods for one or more generic functions, possibly restricted to those involving specified classes.
showMethods(f=character(), where=-1, classes=NULL, includeDefs=FALSE,
inherited=TRUE, printTo = stdout())
f |
One or more function names. If omitted, all functions will be examined. |
where |
If |
classes |
If argument |
includeDefs |
If |
inherited |
If |
printTo |
The connection on which the printed information will be
written. If |
The output style is different from S-Plus in that it does not show the database from which the definition comes, but can optionally include the method definitions.
If printTo
is FALSE
, the character vector that would
have been printed is returned; otherwise the value is the connection
or filename.
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. For a discussion of details and ongoing development, see the web page http://developer.r-project.org/methodsPackage.html and the pointers from that page.
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.
## assuming the methods for plot
## are set up as in the documentation for 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)