add_to_dictionary {cleanepi}R Documentation

Add an element to the data dictionary

Description

Add an element to the data dictionary

Usage

add_to_dictionary(dictionary, option, value, grp, order = NULL)

Arguments

dictionary

A data frame with the data dictionary

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
 )

[Package cleanepi version 1.0.2 Index]