Description Usage Arguments Value Author(s) Examples
View source: R/clean_colnames.R
It cleans column names (my relative definition of 'clean'). Specifically, it separates with underscore (e.g., "pikaPika" to "pika_Pika"), replaces blank spaces with underscore, replaces multiple symbols with single underscore, and removes symbols after last word. These steps are followed IN THAT ORDER.
1 | clean_colnames(column_names)
|
column_names |
A vector with column names |
A vector with clean names
Guillermo Basulto-Elias
1 2 3 4 5 6 7 8 9 10 | clean_colnames(c("bart Simpson", "LisaSimpson", "maggie..simpson!",
"MARGE-Simpson", "Homer Simpson :-)"))
## Get warning if there are repeated colum names
## Not run:
clean_colnames(c("bart Simpson", "LisaSimpson",
"maggie..simpson!", "MARGE-Simpson", "bart-Simpson",
"Homer Simpson :-)"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.