anyFalse: Alias for 'any(!(...))'

View source: R/vector_tools.R

anyFalseR Documentation

Alias for any(!(...))

Description

any_false(...) returns TRUE if anything in ... is FALSE; it's the opposite of any(...), which returns TRUE if anything in ... is TRUE.

Usage

anyFalse(..., na.rm = FALSE)

Arguments

...

(Vectors) Zero or more logical vectors.

na.rm

(Logical) If TRUE, NA values are removed before the result is computed.

Details

This function exists to avoid confusion when negating any(); any(!c(TRUE, FALSE)) == TRUE, but !any(c(TRUE, FALSE)) == FALSE, and the difference is which part of the expression you negate. In many cases, you want the former because you are testing whether anything in the vector is FALSE, and that's what this function does.

Value

Logical vector.

Authors

Examples

anyFalse(c(TRUE, TRUE))
#> [1] FALSE

anyFalse(c(FALSE, FALSE))
#> [1] TRUE

anyFalse(c(TRUE, FALSE))
#> [1] TRUE


DesiQuintans/desiderata documentation built on April 9, 2023, 5:43 a.m.