powered by
value
enum
Check if value is in the given enum. If not, stops with an error.
validateEnumValue(value, enum, nullAllowed = FALSE)
A value to search for in the enum.
enum where the value should be contained.
If TRUE, value can be NULL and the test always passes. If FALSE (default), NULL is not accepted and the test fails.
TRUE
NULL
FALSE
# NOT RUN { Symbol <- enum(c(Diamond = 1, Triangle = 2, Circle = 2)) validateEnumValue(1, Symbol) # }
Run the code above in your browser using DataLab