Check whether an object is a single missing value (NA).
Details
This is a strict helper that returns TRUE only if x is an
atomic vector of length one and equal to NA. In contrast to
is.na(), which is vectorized, isNA is intended for
scalar checks, e.g. in conditional statements.
This function differs from is.na() in that it:
Only returns
TRUEfor length-one inputsReturns a single logical value (not vectorized)
Works consistently across all NA types
See also
Other vector.na:
coalesceX(),
locf(),
naIf(),
naReplace()
