powered by
These functions work exactly the same as x == TRUE and x == FALSE but by default return FALSE for cases that are NA.
x == TRUE
x == FALSE
FALSE
NA
isTRUENA(x, ifNA = FALSE)isFALSENA(x, ifNA = FALSE)
isFALSENA(x, ifNA = FALSE)
Logical or value specified in ifNA.
ifNA
Logical, or a condition that evaluates to logical, or a vector of logical values or conditions to evaluate.
Logical, value to return if the result of evaluating x is NA. Note that this can be anything (i.e., TRUE, FALSE, a number, etc.).
x
TRUE
isFALSENA(): Vectorized test for truth robust to NA
isFALSENA()
isTRUE, isFALSE, TRUE, logical
isTRUE
isFALSE
logical
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)
Run the code above in your browser using DataLab