library(checkmate)
x = c(0, 1, 2, 3)
check_numeric(x) %check&&% check_names(names(x), "unnamed") # is TRUE
check_numeric(x) %check&&% check_true(all(x < 0)) # fails
check_numeric(x) %check||% check_character(x) # is TRUE
check_number(x) %check||% check_flag(x) # fails
Run the code above in your browser using DataLab