group_vec: Collapse vector into groups.

Description Usage Arguments

View source: R/strings.R

Description

For each value in a vector group_vec finds first match in list of vectors and returns name of the vector.

Usage

1
group_vec(x, l, no.match = NULL, USE.NAMES = TRUE, fixed = TRUE)

Arguments

x

a character vector

l

a (usually named) list of character vectors

no.match

value that should be returned if no match is found. Usually NA or "other". If NULL (default) the original value itself is returned.

USE.NAMES

logical passed to sapply indicating whether a result should be a named vector (for character input vectors only).

fixed

logical; allows match based on regular expressions


vh-d/VHtools documentation built on May 3, 2019, 6:11 p.m.