An often forgotten R-function while developing:
isTRUE() and it’s brother
Have you found yourself in the situation that you had to write
Much shorter is the following:
This additional code is often necessary if
foo is a list and we are not certain that
bar is an element of it.
So first we have to check, whether
bar is not
Otherwise you get the following error
If you didn’t now before
|| stop the evaluation as soon as possible.
a && b && c does not check
a is already
Vice versa with a || b || c
there is no more necessity to look at c
because the whole expression is already TRUE`.
But in R we also have the single
These are meant to compare logical vectors as in