Skip to contents

Return the value that is stored under the given key. If the key is not present, an error is thrown.

Usage

enumGetValue(enum, key)

Arguments

enum

The enum that contains the key-value pair.

key

The key under which the value is stored.

Value

Value that is assigned to key.

See also

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

Examples

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