Learn R Programming

lintr (version 3.0.2)

outer_negation_linter: Require usage of !any(.) over all(!.), !all(.) over any(!.)

Description

any(!x) is logically equivalent to !any(x); ditto for the equivalence of all(!x) and !any(x). Negating after aggregation only requires inverting one logical value, and is typically more readable.

Usage

outer_negation_linter()

Arguments

Tags

best_practices, efficiency, readability

See Also

linters for a complete list of linters available in lintr.