overwrite: Create function that modifies text elements in a vector

View source: R/modifyHelpers.R

overwriteR Documentation

Create function that modifies text elements in a vector

Description

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"))
## regular expressions
myfun2 <- overwrite("b.*","d")
myfun2(c("a","b","c","abc"))

NMsim documentation built on Nov. 2, 2024, 9:06 a.m.