pof_labeller: Label categorical variables from POF microdata

View source: R/pof_labeller.R

pof_labellerR Documentation

Label categorical variables from POF microdata

Description

This function labels categorical variables from POF microdata.

Usage

pof_labeller(data_pof, dictionary.file)

Arguments

data_pof

A tibble of POF microdata read with read_pof function.

dictionary.file

The dictionary file for selected survey available on official website: (select the dictionary and input zip file, according to the appropriated select the dictionary and input zip file, according to the appropriated year, microdata folder and then, inside, documentation) - https://ftp.ibge.gov.br/Orcamentos_Familiares/.

Value

A tibble with the data provided from POF survey and its categorical variables as factors with related labels.

Note

For more information, visit the survey official website <https://www.ibge.gov.br/estatisticas/sociais/trabalho/9050-pesquisa-de-orcamentos-familiares.html?=&t=o-que-e> and consult the other functions of this package, described below.

See Also

get_pof for downloading, labeling, deflating and creating survey design object for POF microdata.
read_pof for reading POF microdata.
pof_deflator for adding deflator variables to POF microdata.
pof_design for creating POF survey design object.
pof_example for getting the path of the POF toy example files.

Examples


# Using data read from disk
input_path <- pof_example(path="input_example.txt")
data_path <- pof_example(path="exampledata.txt")
dictionary.path <- pof_example(path="dictionaryexample.xls")
pof.df <- read_pof(microdata=data_path, input_txt=input_path, vars=c("V0407","V0408"))
pof.df <- pof_labeller(data_pof=pof.df, dictionary.file=dictionary.path)

# Downloading data
pof.df2 <- get_pof(year=2017, selected=FALSE, anthropometry=FALSE, vars=c("V0407","V0408"),
                       labels=FALSE, deflator=FALSE, design=FALSE, savedir=tempdir())
dictionary.path2 <- pof_example(path="dictionaryexample.xls")
pof.df2 <- pof_labeller(data_pof=pof.df2, dictionary.file=dictionary.path2)

POFIBGE documentation built on March 25, 2022, 1:05 a.m.