#' Title
#'
#' @param data
#' @param verbose
#' @param DEBUG
#' @param upper
#' @param forbiden.char
#' @param forbiden.last.char
#'
#' @return
#' @export
#'
#' @examples
cleanVarNames <- function(data, verbose=TRUE, DEBUG=FALSE, upper = TRUE,
forbiden.char = c(" ",".",":",";","-","__","(",")","[","]","{","}","$","%","&","/","\\","!"),
forbiden.last.char = c("_"," ")) {
if(!is.data.frame(data)) stop("'data' is not a data.frame")
var.names <- names(data)
if(verbose) message("[cleanVarNames] Cleaning...")
for(cont in seq_along(var.names)){
if(DEBUG) message("Cleaning ",var.names[cont])
var.names[cont] <- strClean(var.names[cont],
upper = upper, DEBUG = DEBUG,
forbiden.char = forbiden.char,
forbiden.last.char = forbiden.last.char)
}
names(data) <- var.names
return(data)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.