charmap: Substituting Strings Against a Mapping Table

View source: R/utils.R

charmapR Documentation

Substituting Strings Against a Mapping Table

Description

Match the elements of a character vectors against a mapping table, that can specify multiple exact or partial matches.

Usage

charmap(x, maps, nomatch = NULL, partial = FALSE, rev = FALSE)

Arguments

x

character vector to match

maps

mapping tables. May be a character vector, a list of character vectors or a function.

nomatch

character string to be used for non-matched elements of x. If NULL, these elements are left unchanged.

partial

logical that indicates if partial matches are allowed, in which case mappings are used as regular expressions.

rev

logical that indicates if the mapping should be interpreted in the reverse way.

Value

A character vector.


renozao/pkgmaker documentation built on May 3, 2023, 6:04 p.m.