VectorSub: Pattern Matching and Replacement From Vectors

Description Usage Arguments Value Examples

Description

extending gsub by matching pattern and replacement from two vectors

Usage

1
VectorSub(pattern, replacement, string)

Arguments

pattern

vector containing words to match

replacement

vector containing words to replace existing words.

string

string to replace from

Value

modified string with replaced values

Examples

1
2
3
4
5
 pattern <- c("A","B","C")
 replacement <- 1:3
 string <- "A went to B went to C"
 VectorSub(pattern,replacement,string)
 # [1] "1 went to 2 went to 3"

bfw documentation built on May 2, 2019, 6:51 a.m.