-
Notifications
You must be signed in to change notification settings - Fork 188
Open
Labels
Description
all.equal()
has a strange return pattern -- it's TRUE
on "success", but typically character (at least in all the base methods) on "failure".
Therefore it's inappropriate to test if(all.equal(...))
-- instead we should use if(isTRUE(all.equal(...)))
.
Here's a couple hundred hits in CRAN packages using if(all.equal(...))
:
Note that this advice is very explicit in ?all.equal
:
Do not use
all.equal
directly inif
expressions—either useisTRUE(all.equal(....))
oridentical
if appropriate.
Filed as a new linter since no existing linter comes to mind that would accommodate this. Closest is maybe vector_logic_linter()
but it's too far a stretch IMO.
IndrajeetPatil and m-muecke