checkChoice: Check if an object is an element of a given set
Description
Check if an object is an element of a given setUsage
checkChoice(x, choices)assertChoice(x, choices, .var.name)
testChoice(x, choices)
Arguments
.var.name
[character(1)]
Name for x
. Defaults to a heuristic to determine
the name using deparse
and substitute
. choices
[atomic
]
Set of possible values.
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.