Learn R Programming

PNADcIBGE (version 0.7.0)

pnadc_labeller: Label categorical variables from PNADC microdata

Description

This function labels categorical variables from PNADC microdata.

Usage

pnadc_labeller(data_pnadc, dictionary.file)

Value

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

Arguments

data_pnadc

A tibble of PNADC microdata read with read_pnadc function.

dictionary.file

The dictionary file for selected survey available on official website:
Quarter (select the dictionary and input zip file) - https://ftp.ibge.gov.br/Trabalho_e_Rendimento/Pesquisa_Nacional_por_Amostra_de_Domicilios_continua/Trimestral/Microdados/Documentacao/.
Annual per Interview (select a dictionary xls file, according to the appropriated interview and, then, inside the documentation folder, choose the desired year) - https://ftp.ibge.gov.br/Trabalho_e_Rendimento/Pesquisa_Nacional_por_Amostra_de_Domicilios_continua/Anual/Microdados/Visita/.
Annual per Topic (select a dictionary xls file, according to the appropriated quarter related to the topic, inside the documentation folder) - https://ftp.ibge.gov.br/Trabalho_e_Rendimento/Pesquisa_Nacional_por_Amostra_de_Domicilios_continua/Anual/Microdados/Trimestre/.

See Also

get_pnadc for downloading, labeling, deflating and creating survey design object for PNADC microdata.
read_pnadc for reading PNADC microdata.
pnadc_deflator for adding deflator variables to PNADC microdata.
pnadc_design for creating PNADC survey design object.
pnadc_example for getting the path of the quarter PNADC toy example files.

Examples

Run this code
# Using data read from disk
input_path <- pnadc_example(path="input_example.txt")
data_path <- pnadc_example(path="exampledata.txt")
dictionary.path <- pnadc_example(path="dictionaryexample.xls")
pnadc.df <- read_pnadc(microdata=data_path, input_txt=input_path, vars=c("VD4001","VD4002"))
pnadc.df <- pnadc_labeller(data_pnadc=pnadc.df, dictionary.file=dictionary.path)
# \donttest{
# Downloading data
pnadc.df2 <- get_pnadc(year=2017, quarter=4, vars=c("VD4001","VD4002"), defyear=2017, defperiod=4,
                      labels=FALSE, deflator=FALSE, design=FALSE, savedir=tempdir())
dictionary.path2 <- pnadc_example(path="dictionaryexample.xls")
pnadc.df2 <- pnadc_labeller(data_pnadc=pnadc.df2, dictionary.file=dictionary.path2)# }

Run the code above in your browser using DataLab