Learn R Programming

bayesbio (version 1.0.0)

mgsub: Multiple pattern gsub.

Description

An extension to gsub that handles vectors of patterns and replacements, avoiding recursion problems associated with overlap at the extense of computation time.

Usage

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

Arguments

pattern
Character vector of patterns to match.
replacement
Character vector of replacements for each pattern.
x
Character vector in which the gsub should be performed.
...
Additional arguments to grep.

References

http://stackoverflow.com/a/15254254/560791