\HeaderA{all}{Are All Values True?}{all}
\keyword{logic}{all}
\begin{Description}\relax
Given a set of logical vectors, are all of the values true?
\end{Description}
\begin{Usage}
\begin{verbatim}
all(..., na.rm = FALSE)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{...}] zero or more logical vectors.  Other objects of zero
length are ignored, and the rest are coerced to logical ignoring
any class.
\item[\code{na.rm}] logical.  If true \code{NA} values are removed before
the result is computed.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This 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.

Coercion of types other than integer (raw, double, complex, character,
list) gives a warning as from \R{} 2.7.0, as this was often unintentional.
\end{Details}
\begin{Value}
The value is a logical vector of length one.

Let \code{x} denote the concatenation of all the logical vectors in
\code{...} (after coercion), after removing \code{NA}s if requested by
\code{na.rm = TRUE}.

The value returned is \code{TRUE} if all of the values in \code{x} are
\code{TRUE} (including if there are no values), and \code{FALSE} if at
least one of the values in \code{x} is \code{FALSE}.  Otherwise the
value is \code{NA} (which can only occur if \code{na.rm = FALSE} and
\code{...} contains no \code{FALSE} values and at least one
\code{NA} value).
\end{Value}
\begin{Section}{S4 methods}
This is part of the S4 \code{\LinkA{Summary}{Summary}}
group generic.  Methods for it must use the signature
\code{x, ..., na.rm}.
\end{Section}
\begin{Note}\relax
That \code{all(logical(0))} is true is a useful convention:
it ensures that
\begin{alltt}
  all(all(x), all(y)) == all(x,y)
\end{alltt}
even if \code{x} has length zero.
\end{Note}
\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
\code{\LinkA{any}{any}}, the \sQuote{complement} of \code{all}, and
\code{\LinkA{stopifnot}{stopifnot}(*)} which is an \code{all(*)}
\sQuote{insurance}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
range(x <- sort(round(stats::rnorm(10) - 1.2, 1)))
if(all(x < 0)) cat("all x values are negative\n")

all(logical(0))  # true, as all zero of the elements are true.
\end{ExampleCode}
\end{Examples}

