These functions work exactly the same as x == TRUE
and x == FALSE
but by default return FALSE
for cases that are NA
.
Examples
x <- c(TRUE, TRUE, FALSE, NA)
x == TRUE
#> [1] TRUE TRUE FALSE NA
isTRUENA(x)
#> [1] TRUE TRUE FALSE FALSE
x == FALSE
#> [1] FALSE FALSE TRUE NA
isFALSENA(x)
#> [1] FALSE FALSE TRUE FALSE
isTRUENA(x, ifNA = Inf)
#> [1] 1 1 0 Inf
# note that isTRUE and isFALSE are not vectorized
isTRUE(x)
#> [1] FALSE
isFALSE(x)
#> [1] FALSE