Re: [R] Logical Operators' inconsistent Behavior

2017-05-19 Thread Thierry Onkelinx
& -> AND -> results only TRUE if both inputs are TRUE. Hence: FALSE AND unknown = FALSE, TRUE AND unknown = unknown | -> OR -> results in TRUE as soon as one of the inputs is TRUE. Hence FASE or unknown = unknown, TRUE or unknown = TRUE TRUE == NA and FALSE == NA compares TRUE/FALSE against unknown

[R] Logical Operators' inconsistent Behavior

2017-05-19 Thread Ramnik Bansal
Hi, I need to understand the inconsistent behaviour of & and I operators when used with NA. The code below explains this inconsistency > TRUE & NA [1] NA > FALSE & NA [1] FALSE > TRUE & NA [1] NA > FALSE | NA [1] NA > TRUE | NA [1] TRUE > TRUE == NA [1] NA > FALSE == NA [1] NA [[a