daDoctoR/man/replace_char.Rd

26 lines
749 B
Plaintext
Raw Normal View History

2022-03-02 10:05:58 +01:00
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/replace_char.R
\name{replace_char}
\alias{replace_char}
\title{Replacing specific characters or string elements with gsub()}
\usage{
replace_char(char.vec, to.be.rep, replacement)
}
\arguments{
\item{char.vec}{Vector of elements with to replace.}
\item{to.be.rep}{Vector of characters to replace.}
\item{replacement}{Vector of characters to replace with.}
}
\description{
Using gsub() to make repeated character string element replacements.
}
\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)
}
\keyword{replace}