grapes-or-grapes: Extract value or return default

Description Usage Arguments Value Examples

Description

A pretty clever approach for accessing part of a list, returning a default if there is nothing of that name in the list. This was taken from https://stackoverflow.com/questions/26561518/built-in-for-getting-list-element-or-default

Usage

1
a %or% b

Arguments

a

Value to use, unless empty.

b

Alternative value to use, if a is empty.

Value

a unless empty, in which case b is returned.

Examples

1
NULL %or% "default"

steveneschrich/IncrementalRMA documentation built on Dec. 23, 2021, 5:32 a.m.