\Header{Methods}{Internal and Group Methods and Generic Functions}
\alias{.Class}{Methods}
\alias{.Generic}{Methods}
\alias{.Group}{Methods}
\alias{.Method}{Methods}
\alias{Math}{Methods}
\methalias{Math.data.frame}{Methods}
\methalias{Math.factor}{Methods}
\alias{Ops}{Methods}
\methalias{Ops.data.frame}{Methods}
\methalias{Ops.factor}{Methods}
\methalias{Ops.ordered}{Methods}
\alias{Summary}{Methods}
\methalias{Summary.data.frame}{Methods}
\methalias{Summary.factor}{Methods}
\keyword{methods}{Methods}
\begin{Description}\relax
Many \R-internal functions  are \emph{generic} and  allow
methods to be written for.  \emph{Group} methods in particular are
available for the \code{"Math"},  \code{"Ops"}, and
\code{"Summary"} group.\end{Description}
\begin{Usage}
\begin{verbatim}
Math.data.frame(x, ...)
Math.factor(x, ...)

Ops.data.frame(e1, e2 = NULL)
Ops.factor(e1, e2)
Ops.ordered(e1, e2)

Summary.data.frame(x, ...)
Summary.factor(x, ...)

.Method
.Generic
.Group
.Class
\end{verbatim}
\end{Usage}
\begin{Section}{Group Dispatching}
There are three \emph{groups} for which methods can be written, namely
the \code{"Math"}, \code{"Ops"} and \code{"Summary"} groups.

A function \emph{\code{f}} belonging to one of these groups must be
\code{\Link{.Internal}} or \code{\Link{.Primitive}} and will
automatically be using \emph{\code{<grp>.<class> (ob)}} when
\emph{\code{f(<ob>)}} is called, \emph{\code{f}} belongs to group
\emph{\code{<grp>}} and \emph{\code{<ob>}} is of \code{\Link{class}}
\emph{\code{<class>}}.

\Enumerate{
\item Group \code{"Math"}:
\Itemize{
\item \code{abs}, \code{sign}, \code{sqrt}, \\
\code{floor}, \code{ceiling}, \code{trunc},\\
\code{round}, \code{signif}


\item \code{exp}, \code{log}, \\
\code{cos}, \code{sin}, \code{tan},\\
\code{acos}, \code{asin}, \code{atan}

\code{cosh}, \code{sinh}, \code{tanh},\\
\code{acosh}, \code{asinh}, \code{atanh}

\item \code{lgamma}, \code{gamma}, \code{gammaCody},\\
\code{digamma}, \code{trigamma}, \code{tetragamma},
\code{pentagamma}

\item \code{cumsum}, \code{cumprod}, \code{cummax}, \code{cummin}
}

\item Group \code{"Ops"}:
\Itemize{
\item \code{"+"}, \code{"-"}, \code{"*"}, \code{"/"},
\code{"\textasciicircum{}"}, \code{"\%\%"}, \code{"\%/\%"}

\item \code{"\&"}, \code{"|"}, \code{"!"}

\item \code{"=="}, \code{"!="}, 
\code{"<"}, \code{"<="}, \code{">="}, \code{">"}
}

\item Group \code{"Summary"}:
\Itemize{
\item \code{all}, \code{any}

\item \code{sum}, \code{prod}
\item \code{min}, \code{max}
}
}\end{Section}
\begin{Section}{Simple Dispatching}
The following builtin functions are \emph{generic} as well, i.e., you
can write \code{\Link{methods}} for them:

\code{\Link{[}},            
\code{\Link{[[}}            

\code{\Link{dimnames<\Rdash}},   
\code{\Link{dimnames}},     
\code{\Link{dim<\Rdash}},        
\code{\Link{dim}}           

\code{\Link{c}}, 
\code{\Link{unlist}}, 
\code{\Link{as.vector}}, 
\code{\Link{is.na}}, 
\code{\Link{is.nan}}\end{Section}
\begin{References}\relax
Appendix A, \emph{Classes and Methods} of\\
Chambers, J. M.  and Hastie, T. J. eds (1992)
\emph{Statistical Models in S.}
Wadsworth \& Brooks/Cole.\end{References}
\begin{SeeAlso}\relax
\code{\Link{methods}} for methods of non-Internal generic functions.\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
methods("Math")
methods("Ops")
methods("Summary")

d.fr <- data.frame(x=1:9, y=rnorm(9))
data.class(1 + d.fr) == "data.frame" ##-- add to d.f. ...
\end{ExampleCode}
\end{Examples}

