\HeaderA{summary}{Object Summaries}{summary}
\methaliasA{summary.data.frame}{summary}{summary.data.frame}
\methaliasA{summary.default}{summary}{summary.default}
\methaliasA{summary.factor}{summary}{summary.factor}
\methaliasA{summary.matrix}{summary}{summary.matrix}
\keyword{methods}{summary}
\begin{Description}\relax
\code{summary} is a generic function used to produce result summaries
of the results of various model fitting functions.  The function
invokes particular \code{\LinkA{methods}{methods}} which depend on the
\code{\LinkA{class}{class}} of the first argument.
\end{Description}
\begin{Usage}
\begin{verbatim}
summary(object, ...)

## Default S3 method:
summary(object, ..., digits = max(3, getOption("digits")-3))
## S3 method for class 'data.frame':
summary(object, maxsum = 7,
       digits = max(3, getOption("digits")-3), ...)

## S3 method for class 'factor':
summary(object, maxsum = 100, ...)

## S3 method for class 'matrix':
summary(object, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] an object for which a summary is desired.
\item[\code{maxsum}] integer, indicating how many levels should be shown for
\code{\LinkA{factor}{factor}}s.
\item[\code{digits}] integer, used for number formatting with
\code{\LinkA{signif}{signif}()} (for \code{summary.default}) or
\code{\LinkA{format}{format}()} (for \code{summary.data.frame}).
\item[\code{...}] additional arguments affecting the summary produced.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
For \code{\LinkA{factor}{factor}}s, the frequency of the first \code{maxsum - 1}
most frequent levels is shown, where the less frequent levels are
summarized in \code{"(Others)"} (resulting in \code{maxsum} frequencies).

The functions \code{summary.lm} and \code{summary.glm} are examples
of particular methods which summarise the results produced by
\code{\LinkA{lm}{lm}} and \code{\LinkA{glm}{glm}}.
\end{Details}
\begin{Value}
The form of the value returned by \code{summary} depends on the
class of its argument.  See the documentation of the particular
methods for details of what is produced by that method.
\end{Value}
\begin{References}\relax
Chambers, J. M. and Hastie, T. J. (1992)
\emph{Statistical Models in S}.
Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{anova}{anova}},
\code{\LinkA{summary.glm}{summary.glm}},
\code{\LinkA{summary.lm}{summary.lm}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
summary(attenu, digits = 4) #-> summary.data.frame(...), default precision
summary(attenu $ station, maxsum = 20) #-> summary.factor(...)

lst <- unclass(attenu$station) > 20 # logical with NAs
## summary.default() for logicals -- different from *.factor:
summary(lst)
summary(as.factor(lst))
\end{ExampleCode}
\end{Examples}

