assert_boolean: Assert if an object contains only TRUE or FALSE values

View source: R/assert.R

assert_booleanR Documentation

Assert if an object contains only TRUE or FALSE values

Description

Check that each element of x is either TRUE or FALSE. Works with vectors containing logical values, and/or 0s and 1s, and/or "true", "t", "false", "f" strings (regardless of case).

Usage

assert_boolean(x, name = lang2str(x), is2nd = FALSE, stopOnFail = TRUE)

Arguments

x

(character | numeric | integer | logical) A vector.

name

(character) The name of the vector (used in error messages). Optional.

stopOnFail

(logical) Whether the function stops as soon as one of the check fails, or gathers all error messages first.


salix-d/salixUtils documentation built on Aug. 14, 2024, 7:11 a.m.