Missing values (1)
In most cases an NA
value (vector element) is regarded ‘missing so we can’t (always) know the outcome’:
- hence
NA
in comparisons will always returnNA
.- so
x == NA
will just returnNA
for all elements. - check for missing values with
is.na()
:TRUE
for missing values andFALSE
for everything else
- so