Skip to contents

Perform dictionary-based cleaning

Usage

clean_using_dictionary(data, dictionary)

Arguments

data

The input data frame or linelist

dictionary

A data dictionary associated with the input data

Value

A data frame with cleaned values in the target 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")
)

data$gender[2] <- "homme"
cleaned_df <- clean_using_dictionary(
  data = data,
  dictionary = dictionary
)
#> 
#> Detected misspelled values at lines 2 of column 'gender'
#> Please add the misspelled options to the data dictionary using the add_to_dictionary() function.