Learn R Programming

pkgmaker (version 0.32.10)

charmap: 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)

Value

A character vector.

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.