replace_char: Replacing specific characters or string elements with gsub()

View source: R/replace_char.R

replace_charR Documentation

Replacing specific characters or string elements with gsub()

Description

Using gsub() to make repeated character string element replacements.

Usage

replace_char(char.vec, to.be.rep, replacement)

Arguments

char.vec

Vector of elements with to replace.

to.be.rep

Vector of characters to replace.

replacement

Vector of characters to replace with.

Examples

  n <- c("Se, en fraek raev", "Oesterland", "Aalborg", "Soester Aase", "Soendergaard")
  p <- c('Ae', 'ae', 'Oe', 'oe','Aa','aa')
  r <- c('Æ', 'æ', 'Ø', 'ø','Å','å')
  replace_char(n,p,r)

agdamsbo/daDoctoR documentation built on Aug. 30, 2022, 4:29 p.m.