View source: R/clean_variable_names.R
| clean_variable_names | R Documentation |
This function standardises the variable names in a
data.frame. It uses the standardisation implemented by
epitrix::clean_labels() in the epitrix package. See
?epitrix::clean_labels for more information.
clean_variable_names(x, protect = FALSE, ...)
x |
a |
protect |
a logical or numeric vector specifying which columns to protect from manipulation |
... |
further arguments passed to |
A data.frame with standardised variable names.
Thibaut Jombart
clean_data() for a one-shot wrapper to clean your data
## make toy data
onsets <- as.Date("2018-01-01") + sample(1:10, 20, replace = TRUE)
gender <- sample(c("male", "female"), 20, replace = TRUE)
case_type <- c("confirmed", "probable", "suspected", "not a case")
case <- sample(case_type, 20, replace = TRUE)
toy_data <- data.frame("Date of Onset." = onsets,
"_GENDER_ " = gender,
"Épi.Case_définition" = case)
## show data
toy_data
## clean variable names, store in new object, show results
clean_data <- clean_variable_names(toy_data)
clean_data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.