Pattern replacement with multiple patterns

gsubs_remove(
  pattern,
  replacement,
  x,
  ignore.case = TRUE,
  replaceMultiple = rep(TRUE, length(pattern)),
  ...
)

Arguments

pattern

character vector of patterns

replacement

character vector of replacements

x

character vector with input data to be curated

ignore.case

logical indicating whether to perform pattern matching in case-insensitive manner, where ignore.case=TRUE will ignore the uppercase/lowercase distinction.

...

additional arguments are passed to base::gsub() or base::sub().

replace_multiple

logical vector indicating whether to perform global substitution, where replace_multiple=FALSE will only replace the first occurrence of the pattern, using base::sub(). Note that this vector can refer to individual entries in pattern.

Details

This function is a simple wrapper around base::gsub() when considering a series of pattern-replacement combinations. It applies each pattern match and replacement in order and is therefore not vectorized.