Learn R Programming

bazar (version 1.0.11)

mgsub: Multiple gsub

Description

The function mgsub is a `multiple' version of gsub.

Usage

mgsub(pattern, replacement, x, ...)

Arguments

pattern

character vector containing regular expressions to be matched in the given character vector.

replacement

a replacement vector of the same length as pattern for matched pattern. Coerced to character if possible.

x

vector or NULL: the values to be matched against.

...

additional parameters to be passed to gsub.

Value

A character vector of the same length as x.

See Also

gsub from package base.

Examples

Run this code
# NOT RUN {
mgsub(c("aa", "AA"), c("bb", "BB"), c("XXaaccAACC", "YYaaccAACC", "ZZaaccAACC"))

# }

Run the code above in your browser using DataLab