\HeaderA{logical}{Logical Vectors}{logical}
\aliasA{as.logical}{logical}{as.logical}
\methaliasA{as.logical.default}{logical}{as.logical.default}
\aliasA{F}{logical}{F}
\aliasA{FALSE}{logical}{FALSE}
\aliasA{is.logical}{logical}{is.logical}
\aliasA{T}{logical}{T}
\aliasA{TRUE}{logical}{TRUE}
\keyword{classes}{logical}
\keyword{logic}{logical}
\begin{Description}\relax
Create or test for objects of type \code{"logical"}, and the basic
logical \dQuote{constants}.
\end{Description}
\begin{Usage}
\begin{verbatim}
TRUE
FALSE
T; F

logical(length = 0)
as.logical(x, ...)
is.logical(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{length}] desired length.
\item[\code{x}] object to be coerced or tested.
\item[\code{...}] further arguments passed to or from other methods.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{TRUE} and \code{FALSE} are part of the \R{} language, where
\code{T} and \code{F} are global variables set to these.
All four are \code{logical(1)} vectors.

\code{is.logical} is generic: you can write methods to handle
specific classes of objects, see \LinkA{InternalMethods}{InternalMethods}.
\end{Details}
\begin{Value}
\code{logical} creates a logical vector of the specified length.
Each element of the vector is equal to \code{FALSE}.

\code{as.logical} attempts to coerce its argument to be of logical
type.  For \code{\LinkA{factor}{factor}}s, this uses the \code{\LinkA{levels}{levels}}
(labels).  Like \code{\LinkA{as.vector}{as.vector}} it strips attributes including
names.

\code{is.logical} returns \code{TRUE} or \code{FALSE} depending on
whether its argument is of logical type or not.
\end{Value}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.
\end{References}

