\Header{NA}{Not Available / ``Missing'' Values}
\alias{is.na}{NA}
\methalias{is.na.data.frame}{NA}
\alias{is.na<\Rdash}{NA}
\methalias{is.na<\Rdash.default}{NA}
\keyword{NA}{NA}
\keyword{logic}{NA}
\keyword{manip}{NA}
\begin{Description}\relax
\code{NA} is a logical constant of length 1 which contains a missing
value indicator.  \code{NA} can be freely coerced to any other vector
type.

The generic function \code{is.na} indicates which elements are missing.

The generic function \code{is.na<-} sets elements to \code{NA}.
\end{Description}
\begin{Usage}
\begin{verbatim}
NA
is.na(x)
## S3 method for class 'data.frame':
is.na(x)

is.na(x) <- value
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] an \R{} object to be tested.
\item[\code{value}] a suitable index vector for use with \code{x}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The \code{NA} of character type is as from R 1.5.0 distinct from the
string \code{"NA"}.  Programmers who need to specify an explicit
string \code{NA} should use \code{as.character(NA)} rather than
\code{"NA"}, or set elements to \code{NA} using \code{is.na<-}.

\code{is.na(x)} works elementwise when \code{x} is a
\code{\Link{list}}. 
The method dispatching is C-internal, rather than via
\code{\Link{UseMethod}}.

Function \code{is.na<-} may provide a safer way to set missingness.
It behaves differently for factors, for example.
\end{Details}
\begin{Value}
The default method for \code{is.na} returns a logical vector of the same
\dQuote{form} as its argument \code{x}, containing \code{TRUE} for those
elements marked \code{NA} or \code{\Link{NaN}} (!) and \code{FALSE}
otherwise.  \code{dim}, \code{dimnames} and \code{names} attributes
are preserved.

The method \code{is.na.data.frame} returns a logical matrix with the
same dimensions as the data frame, and with dimnames taken from the
row and column names of the data frame.
\end{Value}
\begin{References}\relax
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
\emph{The New S Language}.
Wadsworth \& Brooks/Cole.

Chambers, J. M. (1998)
\emph{Programming with Data. A Guide to the S Language}.
Springer.
\end{References}
\begin{SeeAlso}\relax
\code{\Link{NaN}}, \code{\Link{is.nan}}, etc.,
and the utility function \code{\Link{complete.cases}}.

\code{\Link{na.action}}, \code{\Link{na.omit}},
\code{\Link{na.fail}}
on how methods can be tuned to deal with missing values.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
is.na(c(1, NA))        #> FALSE  TRUE
is.na(paste(c(1, NA))) #> FALSE FALSE
\end{ExampleCode}
\end{Examples}

