MyNixOS website logo
Description
Access Data from Brazilian Central Bank: IFdata, Active Institutions, Balance Sheets and Normative Acts
Provides functions to query, retrieve, and tidy economic and financial data from Brazilian Central Bank web services for use in R analyses and workflows. Active institutions information, balance sheets and normative acts.

bacenR

CRAN status R-CMD-check Lifecycle: experimental

The goal of bacenR is to provide R functions to download and work with data from the Brazilian Central Bank (Bacen).

To get data about IPCA, Selic, GDP, Government Debt, and others, check the packages:

Summary

Install

You can install the development version of bacenR like so:

# install.packages("pak") # if you don't have pak installed yet
pak::pak("rtheodoro/bacenR")

Usage

This is a basic example of use:

# Load the package
library(bacenR)

# Download normative legislation related to Credit Cooperatives
normative_data <- get_normative_data(
    terms = c("Cooperativas de Crédito", "Cooperativa de Crédito"), 
    ini_date = "2020-01-01", 
    end_date = Sys.Date()
)

# Download texts of the normative legislation
normative_txt <- get_normative_txt(normative_data)

# Download financial statements of banks and credit cooperatives
get_balance_sheets(
   institution = c("BANCOS", "COOPERATIVAS"),
   months = c(6, 12),
   first_year = 1993,
   final_year = 2023,
   out_dir = "data_raw",
   overwrite = FALSE
)

# Unified treatment of downloaded financial statements
tidy_balance_sheets(
    path_raw = "data_raw", 
    out_dir = "out",
    doc_filter = 4010, 
    save = TRUE
)

# Download list of financial institutions regulated by Bacen
get_institutions(
  institution = c("COOPERATIVAS", "BANCOS"),
  start_date = "202312",
  end_date = "202405",
  out_dir = "data_raw",
  cleanup_zip = TRUE,
  verbose = TRUE
)

# Tidy the institutions data
tidy_institutions(
  path_raw = "data_raw",
  out_dir = "data"
)

# Get data from IFdata Reports
cc_ativa_pj_modalidade_20142024 <- bacenR::get_ifdata_reports(
  year = c(2014:2024),
  month = 12,
  report = 13,
  type_institution = 2
)

# Get data from IFdata Registry (Cadastro)
data <- get_ifdata_registry(
  year = c(2023, 2024), 
  month = c(3, 6, 9, 12)
)

To-do

More details about the to-do list can be found in the GitHub project board.

Feel free to contribute to this list by opening issues or pull requests on GitHub!

Author

Ricardo Theodoro:

How to cite

To cite bacenR in publications, please use:

citation("bacenR")
@manual{,
  title = "bacenR: Access Data from Brazilian Central Bank - IFdata, Active Institutions, Balance Sheets and Normative Acts",
  author = "Ricardo Theodoro",
  year = "2026",
  version = "v0.3.1",
  url = "https://github.com/rtheodoro/bacenR"
}

Support

If this package is useful and saves you time, please consider starring this GitHub repository.

You can also give a penny to charity.

Metadata

Version

0.3.1

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows