In R Language Definition, NA
values are briefly described, a portion of which says
... In particular,
FALSE & NA
To add to @farnsy's great answer, and to elaborate on the difference with ==
and match
:
The key thing to consider is how these two functions (==
and match
) are used.
x == y
translation: Is the value on the left the same value as the one on the right
match(x, table)
translation: Is the value on the left found in the table on the right;
if so, return the index of the FIRST TIME that x appears in table
A common use case I often encounter is working with a set of IDs. Especially, when dealing with two different datasets that have been joined, I might be left with several NAs in one of my ID columns
However, not all NAs represent the same real life object.