Learn R Programming

ospsuite.utils (version 1.2.0)

validateEnumValue: Check if value is in the given enum. If not, stops with an error.

Description

Check if value is in the given enum. If not, stops with an error.

Usage

validateEnumValue(value, enum, nullAllowed = FALSE)

Arguments

value

A value to search for in the enum.

enum

enum where the value should be contained.

nullAllowed

If TRUE, value can be NULL and the test always passes. If FALSE (default), NULL is not accepted and the test fails.

Examples

Run this code
# NOT RUN {
Symbol <- enum(c(Diamond = 1, Triangle = 2, Circle = 2))
validateEnumValue(1, Symbol)
# }

Run the code above in your browser using DataLab