gsubAll: Pattern matching and replacement

Description Usage Arguments Value Author(s) Examples

View source: R/eatModel.r

Description

Function is a wrapper for gsub() which allows to replace more than one pattern.

Usage

1
gsubAll ( string, old, new)

Arguments

string

a character vector where matches are sought

old

character vector containing strings to be matched in the given character vector named string.

new

a replacement for matched pattern

Value

character vector with replaced patterns

Author(s)

Benjamin Becker

Examples

1
2
3
### replace all numbers by words
txt <- "1 example for 2 reasons in 4 seasons"
gsubAll ( txt, old = as.character(1:4), new = c("one", "two", "three", "four"))

eatModel documentation built on May 2, 2019, 6:49 p.m.