I first wondered why
FALSE | NA
returns
#> [1] NA, while
TRUE | NA returns
#> [1] TRUE.
Then I read the explanation that "because the value of the missing element matters in NA | FALSE, these are missing".
So I tried
TRUE | FALSE and
FALSE | TRUE.
And indeed, both return
#>[1] TRUE.
It makes sense that because the result of NA | FALSE depends on the value of NA, it returns NA, while the value of NA does not really matter for NA | TRUE to be TRUE.
However, can someone explain why TRUE | FALSE returns TRUE?
Thank you!