View source: R/column_name_standardization.R
standardize_column_names | R Documentation |
All columns names will be reformatted to snake_case. When the
conversion to snakecase does not work as expected, use the keep
and/or
rename
arguments to reformat the column name properly.
standardize_column_names(data, keep = NULL, rename = NULL)
data |
The input |
keep |
A |
rename |
A named |
A <data.frame>
or <linelist>
with easy to work with
column names.
# do not rename 'date.of.admission'
cleaned_data <- standardize_column_names(
data = readRDS(
system.file("extdata", "test_df.RDS", package = "cleanepi")
),
keep = "date.of.admission"
)
# do not rename 'date.of.admission', but rename 'dateOfBirth' and 'sex' to
# 'DOB' and 'gender' respectively
cleaned_data <- standardize_column_names(
data = readRDS(
system.file("extdata", "test_df.RDS", package = "cleanepi")
),
keep = "date.of.admission",
rename = c(DOB = "dateOfBirth", gender = "sex")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.