\Header{methods}{List Methods for S3 Generic Functions or Classes}
\alias{print.MethodsFunction}{methods}
\keyword{methods}{methods}
\begin{Description}\relax
List all available methods for an S3 generic function, or all
methods for a class.\end{Description}
\begin{Usage}
\begin{verbatim}
methods(generic.function, class)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{generic.function}] a generic function, or a character string naming a
generic function.
\item[\code{class}] a symbol or character string naming a class: only used if
\code{generic.function} is not supplied.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Function \code{methods} can be used to find out about the methods for
a particular generic function or class.  The functions listed are those
which \emph{are named like methods} and may not actually be methods
(known exceptions are discarded in the code).  Note that the listed
methods may not be user-visible objects, but often help will be
available for them.

If \code{class} is used, we check that a matching generic can be found
for each user-visible object named.\end{Details}
\begin{Value}
An object of class \code{"MethodsFunction"}, a
character vector of function names with an \code{"info"} attribute.
There is a \code{print} method which marks with an asterisk any
methods which are not visible: such functions can be examined by
\code{\Link{getS3method}} or \code{\Link{getAnywhere}}.

The \code{"info"} attribute is a data frame, currently with a
logical column, \code{visible} and a factor column \code{from}
(indicating where the methods were found).\end{Value}
\begin{Note}\relax
This scheme is called \emph{S3} (S version 3).  For new projects,
it is recommended to use the more flexible and robust \emph{S4} scheme
provided in the \pkg{methods} package.  Functions can have both S3
and S4 methods, and function \code{\Link{showMethods}} will
list the S4 methods (possibly none).

The original \code{methods} function was written by Martin Maechler.\end{Note}
\begin{References}\relax
Chambers, J. M. (1992)
\emph{Classes and methods: object-oriented programming in S.}
Appendix A of \emph{Statistical Models in S}
eds J. M. Chambers and T. J. Hastie, Wadsworth \& Brooks/Cole.\end{References}
\begin{SeeAlso}\relax
\code{\Link{S3Methods}}, \code{\Link{class}}, \code{\Link{getS3method}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
methods(summary)
methods(class = "aov")
methods("[[")    ##- does not list the C-internal ones...
methods("$")     # currently none
methods("$<-")   # replacement function
methods("+")     # binary operator
methods("Math")  # group generic
## Don't run: 
methods(print)
## End Don't run\end{ExampleCode}
\end{Examples}

