Title: Access to the Great Numbers of Brazilian Individual Income Tax (IRPF)
Version: 0.1.1
Description: Provides functions to download, clean, and structure open data from the Brazilian Federal Revenue (Receita Federal do Brasil - RFB) regarding Personal Income Tax (IRPF) statements. Includes a data dictionary and categorized metadata for several sections such as assets, rights, debts, and income brackets. More information about the data source can be found at https://dados.gov.br/dados/conjuntos-dados/grandes-nmeros-do-imposto-de-renda-da-pessoa-fsica.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.3.3
Imports: dplyr, httr2, janitor, magrittr, readr, tidyr, rlang, tidyselect, tibble
Suggests: knitr, rmarkdown, spelling, testthat (≥ 3.0.0)
Config/testthat/edition: 3
Depends: R (≥ 3.5)
Language: en-US
URL: https://github.com/luabragadeoliveira/irpfR
BugReports: https://github.com/luabragadeoliveira/irpfR/issues
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2026-04-25 18:57:51 UTC; luabr
Author: Luã Braga de Oliveira [aut, cre]
Maintainer: Luã Braga de Oliveira <luabragadeoliveira@gmail.com>
Repository: CRAN
Date/Publication: 2026-04-28 19:20:08 UTC

Pipe operator

Description

See magrittr::%>% for details.

Usage

lhs %>% rhs

Arguments

lhs

A value or the magrittr placeholder.

rhs

A function call using the magrittr semantics.

Value

The result of calling rhs(lhs).


Download and Clean IRPF Data

Description

This function connects to the Brazilian Federal Revenue (RFB) open data server, downloads the CSV for the requested section, and performs data cleaning (standardizing names, pivoting to tidy format, and adjusting currency scales).

Usage

get_irpf(section)

Arguments

section

A string representing the section name (e.g., "bens_e_direitos").

Value

A tidy tibble with columns: ano_calendario, atributo, and valor.

Examples


 df <- get_irpf("bens_e_direitos")
 head(df)


Get Metadata for a Specific IRPF Section

Description

Returns a detailed dictionary of all attributes (columns) present in a specific IRPF data section.

Usage

get_metadata(section)

Arguments

section

A string representing the section name (see get_sections()).

Value

A tibble with columns atributo and descricao.

Examples

get_metadata("bens_e_direitos")

List Available IRPF Data Sections

Description

This function returns a table containing all the available data sections that can be retrieved from the Great Numbers of Brazilian Individual Income Tax (IRPF) through this package.

Usage

get_sections()

Value

A tibble with two columns: secao (the key to be used in other functions) and descricao (a brief explanation of the data).

Examples

get_sections()