lookup_function_from_dict: Creating a lookup function from dictionary

Description Usage Arguments Value

View source: R/purrr-like.R

Description

Creating a lookup function from dictionary

Usage

1
lookup_function_from_dict(dict, default = identity, dict_key_is_regex = F)

Arguments

dict

A dictionaryish character vector (named: key -> value)

default

Value to return if key is not found, or function to evaluate with key as argument

dict_key_is_regex

If True, treats dictionary keys are regular expressions when matching

Value

A function which can be called with keys and performs the described lookup, returning the value (string)


tidytidbits documentation built on March 8, 2021, 5:07 p.m.