match1of: Find matching candidate

Description Usage Arguments Value Examples

Description

Find matching candidate

Usage

1
match1of(candidates, x, ...)

Arguments

candidates

Character vector of candidates to be matched against ‘x’

x

Character vector

...

Further arguments passed on to grepl

Value

A character vector of the same length as ‘x’ where element i contains the first element of ‘candidates’ that matches in ‘x[i]’, or NA if none of the candidates match.

Examples

1
match1of(c("foo", "bar", "xxx", "baz", "quux"), c("foo", "bar", "quux"))

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