In R, the expression all(NA == NA)
will return NA
, not TRUE
or FALSE
. This is because the comparison of two NA
values is also NA
in R.
In R, NA
represents missing or undefined values, and any comparison involving NA
results in NA
. Therefore, the logical expression NA == NA
is NA
, and when you use all()
on it, the result will be NA
.