## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## -----------------------------------------------------------------------------
library(irpfR)

# List available datasets
sections <- get_sections()
head(sections)

## -----------------------------------------------------------------------------
# Get descriptions for the "Assets and Rights" (Bens e Direitos) section
metadata <- get_metadata("bens_e_direitos")
head(metadata)

## -----------------------------------------------------------------------------
# Download data for "Assets and Rights"
df_bens <- get_irpf("bens_e_direitos")

# The resulting data is tidy
# Columns: ano_calendario, atributo, valor
head(df_bens)

