In base package, I can substitute "." to "_" with the following code,
names(iris)<-sub("\\.", "_", names(iris))
or
names(iris)<-sub(".", "_", fixed = T,names(iris))
How can I achieve this in dplyr with verb select?
I saw one answer
iris %>% rename_(.dots=setNames(names(.), tolower(gsub("\\.", "_", names(.)))))
from this link:R dplyr: rename variables using string functions. It seems a bit complicated, any simple solutions?