isTRUENA {omnibus} | R Documentation |
Vectorized test for truth robust to NA
Description
These functions work exactly the same as x == TRUE
and x == FALSE
but by default return FALSE
for cases that are NA
.
Usage
isTRUENA(x, ifNA = FALSE)
isFALSENA(x, ifNA = FALSE)
Arguments
x |
Logical, or a condition that evaluates to logical, or a vector of logical values or conditions to evaluate. |
ifNA |
Logical, value to return if the result of evaluating |
Value
Logical or value specified in ifNA
.
Functions
-
isFALSENA()
: Vectorized test for truth robust to NA
See Also
isTRUE
, isFALSE
, TRUE
, logical
Examples
x <- c(TRUE, TRUE, FALSE, NA)
x == TRUE
isTRUENA(x)
x == FALSE
isFALSENA(x)
isTRUENA(x, ifNA = Inf)
# note that isTRUE and isFALSE are not vectorized
isTRUE(x)
isFALSE(x)
[Package omnibus version 1.2.13 Index]