find_first_match: Find first matching candidate

Description Usage Arguments Value Examples

Description

Find first matching candidate

Usage

1
find_first_match(candidates, x, ...)

Arguments

candidates

Character vector of candidates to be matched against ‘x’

x

Character vector

...

Further arguments passed on to grepl

Value

#' Index of the element of ‘candidates’ that matches the element of ‘x’ with the smallest index. In case of ties, the smallest of the tied indexes is returned. If none of the candidates match any of the elements in ‘x’, NA is returned.

Examples

1
find_first_match(c("foo", "bar", "baz", "quux"), c("baz", "quux", "bar"))

cbaumbach/miscFun documentation built on May 13, 2019, 1:48 p.m.