% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/which.r
\name{whichNA}
\alias{whichNA}
\alias{whichNA<-}
\title{Which indices are NA?}
\usage{
whichNA(x)

whichNA(x) <- value
}
\arguments{
\item{x}{numeric \strong{R} object. Does not accept \code{complex} or \code{raw.}}

\item{value}{value/s to replace \code{NA} values with when using the
assignment function.}
}
\value{
If using \code{whichNA}, integer vector of indices of \code{NA} values
in \code{x}, or matrix of array indices if \code{arr.ind} is \code{TRUE}.
If using \verb{whichNA<-}, the modified object with \code{NA} values replaced by
\code{value}.
}
\description{
Give the indices of \code{NA} values, allowing for array indices.
Use the assignment function \verb{whichNA<-} to replace \code{NA} values
with a given value/s.
}
\details{
\verb{whichNA<-} follows \strong{R}'s usual recycling rules when
replacing \code{NA} values with \code{value}. If there are no \code{NA} values in \code{x},
no replacement is made.
}
\examples{
x <- c(1, NA, 3, NA, 5)
whichNA(x)
whichNA(x) <- 0
x

m <- matrix(c(1, NA, 3, NA, 5, NA), nrow = 2)
whichNA(m)

y <- c("a" = 1, "b" = NA, "c" = 2, "d" = NA, "e" = NA, "f" = NA)
whichNA(y)
whichNA(y) <- c(91, 92) # value recycled to number of NA's
y
}
\seealso{
\link{is.na}, \link{setNA}, \link{whichMin}, \link{whichMax}
}
