strClean: strClean

View source: R/utils.strClean.R

strCleanR Documentation

strClean

Usage

strClean(
  x,
  DEBUG = FALSE,
  upper = FALSE,
  forbiden.char = c(" ", ".", ":", ";", "-", "__", "(", ")", "[", "]", "{", "}", "$",
    "%", "&", "/", "\\", "!"),
  forbiden.last.char = c("_", " ")
)

Arguments

x

string to be cleaned

DEBUG

T/F verbose output (default = FALSE)

upper

transform to upper case (default = FALSE)

forbiden.char

vector with characters to change for '_' if found anywhere (default = c(" ",".",":","-","__","(",")","[","]","","","$","

\item

forbiden.last.charvector with characters to remove if found at the end of the string (default = c("_"," "))

String cleaned strClean

strClean("VAR_NAM;E") #... will return "VAR_NAM_E"


feranpre/feR documentation built on Nov. 22, 2022, 2:29 a.m.