mod_nullable {schematic} | R Documentation |
Allow NA in a predicate
Description
This modifies a predicate function to ignore NAs.
Usage
mod_nullable(pred)
Arguments
pred |
A predicate function |
Value
A new predicate that allows NAs
Examples
# The `is_incrementing` predicate will fail if there are NAs
x <- c(1, NA, 3)
is_incrementing(x) # FALSE
is_incrementing_null <- mod_nullable(is_incrementing)
is_incrementing_null(x) # TRUE
[Package schematic version 0.1.2 Index]