Ir al contenido

Lists the variables of the data files in a module, with their labels when the file has them (SPSS and Stata). Only the file headers are read, so it is quick even for large modules. Use it to choose cols in fa_read().

Uso

fa_variables(
  survey,
  year,
  module,
  file = NULL,
  format = "auto",
  series = NULL,
  cache = fa_cache(),
  period = NULL
)

Argumentos

survey

Short name, for example "enaho". See fa_surveys().

year

One year.

module

One module code.

file

Part of the file name to read, when the module has several data files (e.g. "Sumaria-2024"). A regular expression.

format

"auto" uses the format of the verified copy, or else the first of STATA, SPSS, CSV and DBF that the module has. Stata comes first because it is read exactly, with labels, and quickly; INEI's CSV files can have line breaks inside text answers. You can also ask for one of those formats.

series

For sources with several series, e.g. "panel" in ENAHO.

cache

Cache folder, see fa_cache().

period

For sources with several files per year, the period shown by fa_catalog(), e.g. "Anual - (Ene-Dic)" in EPEN. A regular expression.

Valor

A data frame with file, name, label and type, one row per variable and file.

Detalles

Labels are the ones INEI wrote in the file. Stata limits them to 80 characters, and some are cut (for example the ENA 2022-2025 genetic improvement items P501A_16C to P501A_16E); the full wording is in the data dictionary PDF that comes in the same zip.

Ejemplos

if (FALSE) { # \dontrun{
fa_variables("enaho", 2024, "34")
} # }