Learn R Programming

brfinance (version 0.8.0)

get_unemployment: Get Brazilian Unemployment Rate (PNAD Continua)

Description

Downloads monthly unemployment rate data from the Brazilian Central Bank's SGS (Sistema Gerenciador de Series Temporais). The series corresponds to the unemployment rate from IBGE's Continuous PNAD survey (PNAD Continua), replicated and made available by the Central Bank.

Usage

get_unemployment(
  start_date = "2020-01-01",
  end_date = NULL,
  language = "eng",
  labels = TRUE
)

Value

A data.frame with:

  • date (Date): Reference month

  • value (numeric): Unemployment rate (%)

Arguments

start_date

Start date for the data period. Accepts multiple formats:

  • "YYYY" for year only (e.g., "2020" becomes "2020-01-01")

  • "YYYY-MM" for year and month (e.g., "2020-06" becomes "2020-06-01")

  • "YYYY-MM-DD" for a specific date

  • NULL defaults to "2020-01-01"

end_date

End date for the data period. Accepts the same formats as start_date.

  • NULL defaults to the current date

language

Language for column names in the returned data.frame:

  • "eng" (default): Returns columns date, unemployment_rate

  • "pt": Returns columns data, taxa_desemprego

labels

Logical indicating whether to add variable labels using the labelled package.

Examples

Run this code
if (FALSE) { # interactive()
  # Default: from 2020 to current date (aligned with other functions)
  df <- get_unemployment()

  # Specific period with year-only format
  df2 <- get_unemployment("2018", "2023")

  # Portuguese column names and labels
  df3 <- get_unemployment(language = "pt")

  # Without variable labels
  df4 <- get_unemployment("2020-01-01", "2022-12-31", labels = FALSE)
}

Run the code above in your browser using DataLab