Add an element to the data dictionary
Arguments
- dictionary
A data dictionary in a form of a data frame
- option
A vector of strings with the new options that need to be added to the dictionary.
- value
A vector with the values to be used when replacing the new options.
- grp
A vector with the name of the column that contains the option of interest.
- order
A numeric with the order of the new option.
Value
An object of type data frame. This is the new data dictionary with an additional line that contains the details about the new options.
Examples
test <- add_to_dictionary(
dictionary = readRDS(
system.file("extdata", "test_dict.RDS", package = "cleanepi")
),
option = "ml",
value = "male",
grp = "gender",
order = NULL
)