Boolean operators && and ||

According to the R language definition, the difference between & and && (correspondingly | and ||) is that the former is vectorized while the latter is not.

According to the help text, I read the difference akin to the difference between an “And” and “AndAlso” (correspondingly “Or” and “OrElse”)…
Meaning:
That not all evaluations if they don’t have to be (i.e. A or B or C is always true if A is true, so stop evaluating if A is true)

Could someone shed light here?
Also, is there an AndAlso and OrElse in R?

3 Answers
3

Leave a Comment