Redundancy in "if (x == TRUE)"

1 · Yihui Xie · Sept. 11, 2017, midnight
Last year when I was at JSM, I attended an excellent talk by Nicholas Horton and later nitpicked his R code: ifelse(dest == "ORD" | dest == "MDW", TRUE, FALSE) There is no need to use ifelse() here. The code above is equivalent to: dest == "ORD" | dest == "MDW" I have a feeling that some people are not comfortable when they think about Boolean values without literally seeing the values TRUE or FALSE. I think this is understandable. Personally I try to avoid redundancy, unless I’m explicitly th...