clean_using_dictionary {cleanepi} | R Documentation |
Perform dictionary-based cleaning
Description
Perform dictionary-based cleaning
Usage
clean_using_dictionary(data, dictionary)
Arguments
data |
The input |
dictionary |
A
|
Value
A <data.frame>
or <linelist>
where the target options
have been replaced with their corresponding values in the columns
specified in the data dictionary.
Examples
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
)
[Package cleanepi version 1.1.0 Index]