Commit b303fbf8 authored by Holger Brandl's avatar Holger Brandl
Browse files

better prettyfy for column names

parent d59974ea
...@@ -201,7 +201,14 @@ rify_names <- function(df){ ...@@ -201,7 +201,14 @@ rify_names <- function(df){
df df
} }
pretty_columns <- function(df){ names(df) <- names(df) %>% str_replace_all(c(" "="_", "-"="_", "[.]"="_")) %>% tolower; df} pretty_columns <- function(df){
names(df) <- names(df) %>%
str_replace_all("[#=.()-]+", "_") %>%
str_replace("[_]+$", "") %>%
str_replace("^[_]+", "") %>%
tolower;
df
}
head_html <- function(df, n=5) head(df, n) %>% knitr::kable(format="html") %>% print() head_html <- function(df, n=5) head(df, n) %>% knitr::kable(format="html") %>% print()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment