View source: R/utils_data.table.R
| dt_set_clean_all | R Documentation |
Clean column names and factor levels in-place
dt_set_clean_all(x, prefix_digits = NA)
x |
data.table: Input data.table. Will be modified in-place, if needed. |
prefix_digits |
Character: prefix to add to names beginning with a digit. Set to NA to skip |
Nothing, modifies x in-place.
EDG
library(data.table)
x <- as.data.table(iris)
levels(x[["Species"]]) <- c("setosa:iris", "versicolor$iris", "virginica iris")
names(x)
levels(x[["Species"]])
# ***in-place*** operation means no assignment is needed
dt_set_clean_all(x)
names(x)
levels(x[["Species"]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.