dt_set_clean_names | R Documentation |
This function takes a data.table, and returns the same data.table with column names that are cleaned and stripped of potentially troublesome names
dt_set_clean_names(DT, lower = TRUE)
DT |
a data.table |
lower |
A logical indicating whether all column names should be
made lower case (default |
All space/whitespace characters are replaced with underscores, as are all characters not from A-Z, a-z, an underscore, or a digit
Returns the data.table but with cleaned names
get_clean_names
ejemplo <- as.data.table(iris)
setnames(ejemplo, c("Sepal Length", "Sepal@Width", "Petal Length",
"Petal\\nWidth", "SpĂȘcies"))
dt_set_clean_names(ejemplo)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.