Skip to contents

Create function that modifies text elements in a vector

Usage

overwrite(...)

Arguments

...

Passed to `gsub()`

Value

A function that runs `gsub` to character vectors

Examples

myfun <- overwrite("b","d")
myfun(c("a","b","c","abc"))
#> [1] "a"   "d"   "c"   "adc"
## regular expressions
myfun2 <- overwrite("b.*","d")
myfun2(c("a","b","c","abc"))
#> [1] "a"  "d"  "c"  "ad"