Logical AND and OR operators for check_*
-functions from checkmate
.
Examples
library(checkmate)
x = c(0, 1, 2, 3)
check_numeric(x) %check&&% check_names(names(x), "unnamed") # is TRUE
#> [1] TRUE
check_numeric(x) %check&&% check_true(all(x < 0)) # fails
#> [1] "Must be TRUE"
check_numeric(x) %check||% check_character(x) # is TRUE
#> [1] TRUE
check_number(x) %check||% check_flag(x) # fails
#> [1] "Must have length 1, or Must be of type 'logical flag', not 'double'"