I have the following code that I use to uniform the names into a dataframe (tb):
names(tb) = tolower(names(tb))
names(tb) = gsub("\\:", "", names(tb))
names(tb) = gsub("\\.", "_", names(tb))
names(tb) = gsub("\\-", "_", names(tb))
names(tb) = gsub("[[:space:]+]", "_", names(tb))
I need to apply those 5 strings to multiple dataframes, so I'd like to create a function for this. Can you help me please? Thanks!
chartr("[.- ]", "---", gsub(":", "", tolower(names(tb)))))