Skip to contents

Returns a list of available variables in the POF microdata with their labels. This is a convenience wrapper around pof_dictionary that returns a simplified view.

Usage

pof_variables(
  year = "2017-2018",
  register = NULL,
  search = NULL,
  cache_dir = NULL,
  refresh = FALSE
)

Arguments

year

Character. POF edition (e.g., "2017-2018"). Default is "2017-2018".

register

Character. Register name (e.g., "morador", "domicilio"). If NULL, returns variables from all registers. Default is NULL.

Character. Optional search term to filter variables by name or description. Default is NULL.

cache_dir

Character. Directory for caching downloaded files. Default uses tools::R_user_dir("healthbR", "cache").

refresh

Logical. If TRUE, re-download even if file exists in cache. Default is FALSE.

Value

A tibble with columns: variable, description, position, length, register.

Examples

if (FALSE) { # interactive()
pof_variables("2017-2018", "morador", cache_dir = tempdir())
pof_variables("2017-2018", "domicilio", search = "ebia", cache_dir = tempdir())
}