i have an if loop than needs a logical check.
However the check is x==2
so that
> x<-2
> x==2
[1] TRUE
However when
> x<-NA
> x==2
[1] NA
How can I deal with this problem? I use this check within a for loop and the loop stops executing. When x<-NA, then x==2 should return FALSE