Something I see often while reading code: Testing (in)equality of logical vectors with Boolean values is redundant.
To check if you are using this antipattern somewhere in your project or package, you can use {lintr} 📦:
lintr.r-lib.org/dev/referenc…
#rstats
1
4
32
Correct in principle and for 'standard' programming languages with two boolean values.
But because #rstats has three (!!) you are actually better of using either one of
isTRUE()
isFALSE()
which are also instructive to look at in source (one liners, just hit RETURN)
Oct 30, 2022 · 7:16 PM UTC
2
1
16




