check_operators {mlr3misc}R 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

[Package mlr3misc version 0.18.0 Index]