Skip to contents

Get the key mapped to the given value in an enum

Usage

enumGetKey(enum, value)

getEnumKey(enum, value)

Arguments

enum

The enum where the key-value pair is stored

value

The value that is mapped to the key

Value

Key under which the value is stored. If the value is not in the enum, NULL is returned.

See also

Other enumeration-helpers: enumGetValue(), enumHasKey(), enumKeys(), enumPut(), enumRemove(), enumValues(), enum()

Examples


Symbol <- enum(c(Diamond = 1, Triangle = 2, Circle = 2))
enumGetKey(Symbol, 1)
#> [1] "Diamond"