\HeaderA{range}{Range of Values}{range}
\methaliasA{range.default}{range}{range.default}
\keyword{univar}{range}
\keyword{arith}{range}
\begin{Description}\relax
\code{range} returns a vector containing the minimum and maximum of
all the given arguments.
\end{Description}
\begin{Usage}
\begin{verbatim}
range(..., na.rm = FALSE)

## Default S3 method:
range(..., na.rm = FALSE, finite = FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{...}] any \code{\LinkA{numeric}{numeric}} or character objects.
\item[\code{na.rm}] logical, indicating if \code{\LinkA{NA}{NA}}'s should be
omitted.
\item[\code{finite}] logical, indicating if all non-finite elements should
be omitted.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{range} is a generic function: methods can be defined for it
directly or via the \code{\LinkA{Summary}{Summary}} group generic.
For this to work properly, the arguments \code{...} should be
unnamed, and dispatch is on the first argument.

If \code{na.rm} is \code{FALSE}, \code{NA}
and \code{NaN} values in any of the arguments will cause \code{NA} values
to be returned, otherwise \code{NA} values are ignored.

If \code{finite} is \code{TRUE}, the minimum
and maximum of all finite values is computed, i.e.,
\code{finite=TRUE} \emph{includes} \code{na.rm=TRUE}.

A special situation occurs when there is no (after omission
of \code{NA}s) nonempty argument left, see \code{\LinkA{min}{min}}.
\end{Details}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.
\end{References}
\begin{SeeAlso}\relax
The \code{\LinkA{extendrange}{extendrange}()} utility;
\code{\LinkA{min}{min}}, \code{\LinkA{max}{max}},
\code{\LinkA{Methods}{Methods}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
(r.x <- range(rnorm(100)))
diff(r.x) # the SAMPLE range

x <- c(NA, 1:3, -1:1/0); x
range(x)
range(x, na.rm = TRUE)
range(x, finite = TRUE)
\end{ExampleCode}
\end{Examples}

