detect_key: Finds the key of the first match

Description Usage Arguments Value

View source: R/dict.r

Description

See detect. This function calls the predicate .p on the values of dict, and returns the first key for which the predicate is TRUE.

Usage

1
detect_key(dict, .p, ..., .right = FALSE)

Arguments

dict

a dictionary

.p

a single predicate function (see detect), which is passed the values of dict

...

additional parameters passed to .p

.right

whether to start the search from the beginning or end of the dictionary

Value

the first match for which the predicate is TRUE


stefano-meschiari/dict documentation built on May 30, 2019, 10:44 a.m.