Skip to contents

Produces a data dictionary with standard structure that can be saved alongside processed microdata. Resulting dictionary can be compiled with other survey dictionaries via compileDictionary. This function is typically called at the end of a .R script that generates processed survey microdata.

Usage

createDictionary(data, survey, vintage, respondent)

Arguments

data

Data frame. Survey microdata with variable descriptions stored in columns via var_label.

survey

Character. Unique survey identifier (e.g. "RECS").

vintage

Character. Survey vintage (e.g. 2015).

respondent

Character. Respondent type; either "Household" or "Person" or a string identifiable as such.

Value

Returns a tibble with standard "dictionary" information based on the provided microdata.