R/fixcolnames.R

Defines functions fixcolnames

Documented in fixcolnames

fixcolnames <-
function(x,lowercase=FALSE) {
  ## replaces one or more of non alpha-numeric characters to _
  ## also lowercases the character string
  f <- ifelse(lowercase, tolower, identity)
  gsub("^_|_$","",f(gsub("[^A-Za-z0-9]+","_",as.character(x))))
}
vlulla/vlutils documentation built on May 21, 2019, 12:35 a.m.