is_one_of: Checks if the passed entity is one of the ones in the options...

View source: R/sets.R

is_one_ofR Documentation

Checks if the passed entity is one of the ones in the options vector.

Description

Checks if the passed entity is one of the ones in the options vector.

Usage

is_one_of(value, options, allow_null = FALSE)

Arguments

value

the value to check

options

a vector of options. Value must be one of these for the check not to fail

allow_null

if TRUE, allow the value NULL. If FALSE (default) do not allow NULL.

Examples

## Not run: 
# For assertion
assertthat::assert_that(qscheck::is_one_of(value, c("foo", "bar")))
# For check
if (qscheck::is_one_of(value, c("foo", "bar"))) {}

## End(Not run)


AstraZeneca/qscheck documentation built on Nov. 1, 2023, 4:45 a.m.