The constructors new_numeric_enum()
and
new_generic_enum()
are the basis for the
enum()
command. These can be used instead of
enum()
if speed is pivotal.
new_numeric_enum()
creates and validates a
numeric enum from a named list of numeric arguments
new_generic_enum()
creates and validates a
generic enum from a named list of arguments
These constructors do not have the helpers
associated with the enum()
command, such as
easy NSE or enum class detection.
In general, it is recommended to use the enum()
method, as it is less verbose, easier to read and write, and
more readily picks up on user errors.
new_numeric_enum(.enum_data) new_generic_enum(.enum_data)
.enum_data | named list of arguments |
---|
An enumeration (enum), a list of unique name/value pairs.
#> # A numeric enum: 2 members #> num x : 5 #> num y : 2#> # A generic enum: 2 members #> df x : <32 × 11> #> chr y : string