type.enum: Define a conformance rule to match a factor with specific levels.
Description
Define a conformance rule to match a factor with specific levels.
Usage
type.enum(..., .drop = FALSE, .ordered = FALSE)
Value
a function that can check and convert input into the factor with specified
levels. This will re-level factors with matching levels but in a different order.
Arguments
...
the levels (no quotes, backticks if required)
.drop
should levels present in the data and not specified cause an error
(FALSE the default) or be silently dropped to NA values (TRUE).