check_operators: Logical Check Operators

check_operatorsR Documentation

Logical Check Operators

Description

Logical AND and OR operators for ⁠check_*⁠-functions from checkmate.

Usage

lhs %check&&% rhs

lhs %check||% rhs

Arguments

lhs, rhs

(⁠function()⁠)
⁠check_*⁠-functions that return either TRUE or an error message as a character(1).

Value

Either TRUE or a character(1).

Examples

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

mlr-org/mlr3misc documentation built on Feb. 10, 2025, 12:48 p.m.