\HeaderA{is.na-methods}{is.na() Methods for 'Matrix' Objects}{is.na.Rdash.methods}
\aliasA{is.na,denseMatrix-method}{is.na-methods}{is.na,denseMatrix.Rdash.method}
\aliasA{is.na,sparseMatrix-method}{is.na-methods}{is.na,sparseMatrix.Rdash.method}
\keyword{methods}{is.na-methods}
\begin{Description}\relax
Methods for function \code{\LinkA{is.na}{is.na}()} for all Matrices (objects
extending the \code{\LinkA{Matrix}{Matrix.Rdash.class}} class):

\describe{
\item[x = "denseMatrix"] returns a \code{"nMatrix"} object of same
dimension as \code{x}, with TRUE's whenever \code{x} was NA.
\item[x = "sparseMatrix"] ditto.
}
\end{Description}
\begin{Usage}
\begin{verbatim}
## S4 method for signature 'sparseMatrix':
is.na(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] sparse or dense matrix.
\end{ldescription}
\end{Arguments}
\begin{SeeAlso}\relax
\code{\LinkA{NA}{NA}}, \code{\LinkA{is.na}{is.na}};
\code{\LinkA{nMatrix}{nMatrix.Rdash.class}},
\code{\LinkA{denseMatrix}{denseMatrix.Rdash.class}},
\code{\LinkA{sparseMatrix}{sparseMatrix.Rdash.class}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
M <- Matrix(1:6, nrow=4, ncol=3,
       dimnames = list(c("a", "b", "c", "d"), c("A", "B", "C")))
stopifnot(all(!is.na(M)))
M[2:3,2] <- NA
is.na(M)

A <- spMatrix(10,20, i = c(1,3:8),
                     j = c(2,9,6:10),
                     x = 7 * (1:7))
stopifnot(all(!is.na(A)))
A[2,3] <- A[1,2] <- A[5, 5:9] <- NA
inA <- is.na(A)
stopifnot(sum(inA) == 1+1+5)
\end{ExampleCode}
\end{Examples}

