View source: R/dictionary_based_cleaning.R
clean_using_dictionary | R Documentation |
Perform dictionary-based cleaning
clean_using_dictionary(data, dictionary)
data |
The input |
dictionary |
A
|
A <data.frame>
or <linelist>
where the target options
have been replaced with their corresponding values in the columns
specified in the data dictionary.
data <- readRDS(
system.file("extdata", "messy_data.RDS", package = "cleanepi")
)
dictionary <- readRDS(
system.file("extdata", "test_dict.RDS", package = "cleanepi")
)
# adding an option that is not defined in the dictionary to the 'gender'
# column
data$gender[2] <- "homme"
cleaned_df <- clean_using_dictionary(
data = data,
dictionary = dictionary
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.