option_or_default {saccadr}R Documentation

Extract value for a named list or use default if key is missing

Description

Extract value for a named list or use default if key is missing

Usage

option_or_default(options, key, default)

Arguments

options

Named list

key

String key

default

Default value to be returned, if key is missing.

Value

Value from a list or default value

Examples

option_or_default(list("A" = 25), "A", 20)
option_or_default(list("A" = 25), "B", 20)

[Package saccadr version 0.1.3 Index]