Description Usage Arguments Details Value Examples
These provide better logical operators for catching TRUE and FALSE statements in the presence of 'NA' values. These return 'NA' values as 'FALSE' and thus no 'na.rm' argument is not necessary.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | is_true(x, ...)
is_false(x, ...)
is_na(x, ...)
any_na(x)
all_na(x, ...)
any_true(x)
any_true_x(x)
any_false(x)
any_false_x(x)
all_true(x)
all_true_x(x)
all_false(x)
all_false_x(x)
|
x |
A vector of logical values |
... |
Additional arguments sent to methods (not used) |
The functions [is_true()] and [is_false()] are vectorized and will return a logical vector of the same length as the input 'x' denoting whether or not the values are 'TRUE' or 'FALSE', respectively. The 'all_*()' and 'any_*()' functions apply the vectorized functions and return values of 'TRUE' or 'FALSE'.
Specialized 'any_*_x()' and 'all_*_x()' apply exclusivity to the evaluations. These will return 'NA' is all the values are 'NA' to designate an incompatibility of values. This is useful for when you do not want to apply an evaluation in the _absence_ of data.
Either a vector of logical values or a single logical values (see details).
1 2 3 4 5 6 7 8 | x <- c(TRUE, NA, FALSE)
is_true(x) ## TRUE FALSE FALSE
is_false(x) ## FALSE FALSE TRUE
all_true(x) ## FALSE
all_true(NA) ## FALSE
all_true_x(NA) ## NA
any_true_x(x) ## TRUE
any_true_x(NA) ## NA
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.