Skip to contents

This function extracts the value from an enumerated element by the given index.

Usage

val(elem, index)

Arguments

elem

An enumerated element.

index

The index of the value to extract.

Value

The value at the specified index in the enumerated element.

See also

Examples

# Extract value from an enumerated element by index
elem <- list(1, "a", "b")
val(elem, 2)
#> [1] "b"