The goal of prettifier
is to clean up strings.
You can install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("edo91/prettifier")
This is a basic example which shows you how to solve a common problem:
library(prettifier)
x <- "a1~!#$€%^&*|__+:____()[]{}<>?,./;:'-=òìàèéù dASFGHRV"
prettify_string(x)
#> [1] "a1_oiaeeu_dasfghrv"
# custom replacement
prettify_string(x = "5%_in_€")
#> [1] "5_in_"
prettify_string(x = "5%_in_€", "%" = "perc")
#> [1] "5perc_in_"
prettify_string(x = "5%_in_€", "%" = "perc", "€" = "eur")
#> [1] "5perc_in_eur"