Skip to contents

Reads an official ENEMDU dictionary file in .xlsx, .xls, .ods, or .xlsm format and normalizes it into a long tibble with one row per variable.

Usage

enemdu_read_official_dictionary_file(
  path,
  survey_type = NULL,
  period = NULL,
  dictionary_frequency = NULL,
  dictionary_file_scope = NULL,
  sheet = 1
)

Arguments

path

Path to an official dictionary file.

survey_type

Optional survey type. If NULL, inferred from file name when possible.

period

Optional period. If NULL, inferred from file name when possible.

dictionary_frequency

Optional label such as "Mensual", "Trimestral" or "Anual". If NULL, inferred when possible.

dictionary_file_scope

Optional scope such as "persona", "vivienda_hogar", "vivienda" or "consumidor". If NULL, inferred when possible.

sheet

Sheet name or position. Defaults to first sheet.

Value

A tibble with official dictionary variables.

Details

The official files usually include metadata rows before the actual dictionary body. This function detects the row whose first column is equivalent to "Nombre del campo" and reads the rows below it as variable names and descriptions.