I\'m working with an imported data set that corresponds to the extract below:
set.seed(1)
dta <- data.frame(\"This is Column One\" = runif(n = 10),
You can also try this
set.seed(1)
dta <- data.frame("This is Column One" = runif(n = 10),
"Another amazing Column name" = runif(n = 10),
"!## This Columns is so special€€€" = runif(n = 10),
check.names = FALSE)
dta <- dta %>%
setNames(gsub("[^[:alnum:] ]", perl = TRUE,
"",
names(.))) %>%
setNames(gsub("(\\w)(\\w*)",
"\\U\\1\\L\\2",
perl = TRUE,
names(.)))
names(dta)
[1] "This Is Column One" "Another Amazing Column Name" " This Columns Is So Special"