checkChoice {checkmate}R Documentation

Check if an object is an element of a given set

Description

Check if an object is an element of a given set

Usage

checkChoice(x, choices)

assertChoice(x, choices, .var.name)

testChoice(x, choices)

Arguments

x

[any]
Object to check.

choices

[atomic]
Set of possible values.

.var.name

[character(1)]
Name for x. Defaults to a heuristic to determine the name using deparse and substitute.

Value

Depending on the function prefix: If the check is successful, all functions return TRUE. If the check is not successful, assertChoice throws an error message, testChoice returns FALSE and checkChoice returns a string with the error message.

See Also

Other set: assertSetEqual, checkSetEqual, testSetEqual; assertSubset, checkSubset, testSubset

Examples

testChoice("x", letters)

[Package checkmate version 1.6.0 Index]