Package 'GetFREData'

Title: Reading FRE Corporate Data of Public Traded Companies from B3
Description: Reads corporate data such as board composition and compensation for companies traded at B3, the Brazilian exchange <https://www.b3.com.br/>. All data is downloaded and imported from the ftp site <https://dados.cvm.gov.br/dados/CIA_ABERTA/DOC/FRE/>.
Authors: Marcelo Perlin [aut, cre], Guilherme Kirch [aut]
Maintainer: Marcelo Perlin <[email protected]>
License: GPL-2
Version: 1.2.0
Built: 2026-10-04 11:35:24 UTC
Source: https://github.com/msperlin/getfredata

Help Index


Cleans the local cache folder

Description

This function deletes all downloaded ZIP files, temporary files, and cached datasets stored in the cache folder.

Usage

clean_fre_cache(cache_folder = get_default_cache_dir())

Arguments

cache_folder

Path of cache folder to delete (default = get_default_cache_dir())

Value

A boolean indicating whether the operation succeeded (invisibly)

Examples

## Not run: 
clean_fre_cache()

## End(Not run)

Downloads and reads FRE datasets (deprecated)

Description

'r lifecycle::badge("deprecated")'

'get_fre_data()' was deprecated in v1.0.0 in favour of [get_fre_data2()].

Usage

get_fre_data(...)

Arguments

...

Ignored.

Value

Nothing; always errors.

Examples

## Not run: 
# Use get_fre_data2() instead
l_fre <- get_fre_data2()

## End(Not run)

Downloads and reads FRE datasets

Description

The FRE (formularios de referencia) is the reporting system of companies traded at B3. This function will access the CVM ftp and parse all available files according to user choices such as dates and companies.

Usage

get_fre_data2(
  first_year = lubridate::year(lubridate::today()) - 1,
  last_year = lubridate::year(lubridate::today()),
  companies_cvm_codes = NULL,
  cache_folder = get_default_cache_dir(),
  verbose = TRUE
)

Arguments

first_year

First year of selected data. CVM FRE data is available from 2010 onwards.

last_year

Last year of selected data.

companies_cvm_codes

Numeric vector of CVM company codes to filter. If NULL (default), returns data for all available companies. Use search_company to look up CVM codes.

cache_folder

Path of cache folder to keep cache, raw zip files, and parsed RDS files (default = 'gfred_cache').

verbose

Logical. Whether to print informative messages during execution (default = TRUE).

Details

The resulting list contains tibbles corresponding to individual tables published in the FRE reports:

  • acionador: Stockholders details and equity participation

  • capital_social: Share capital structure and issued shares

  • posicao_acionaria: Equity ownership structure

  • administrador_membro_conselho_fiscal: Board and director composition

  • remuneracao_reconhecida_administradores: Executive compensation details

  • remuneracao_orgaos: Summary of remuneration by corporate body

  • auditor_formulario_referencia: Independent audit firm details

  • distribuicao_dividendo: Dividend distributions and payout metrics

  • dividas: Debt composition by maturity and guarantee

  • And other corporate disclosures.

All tables in the returned list include the cd_cvm column (CVM company code), enabling consistent cross-table joining and filtering by company.

Parsed files are automatically cached as RDS objects in cache_folder/parsed-rds/ to accelerate subsequent queries for the same years.

Value

A list of tibbles, where each element is a different table from the FRE system. All tables include the cd_cvm column, allowing consistent filtering across the entire dataset.

Examples

## Not run: 
l_fre <- get_fre_data2(first_year = 2020, last_year = 2020, cache_folder = tempdir())

# Filter by CVM company codes silently
l_fre <- get_fre_data2(companies_cvm_codes = c(9512, 18627), verbose = FALSE)

## End(Not run)

Returns a up to date table with information about B3 companies

Description

Imports a dataset from cvm <https://sistemas.cvm.gov.br/cadastro/SPW_CIA_ABERTA.ZIP>, containing up to date information about companies, active or not.

Usage

get_info_companies(cache_folder = "gfred_cache")

Arguments

cache_folder

Path of cache folder to keep cache, raw zip files, and parsed RDS files (default = 'gfred_cache').

Value

A dataframe with several information about B3 companies

Examples

## Not run:  # keep cran check fast
df_info <- get_info_companies()
str(df_info)

## End(Not run)

Helps users search for a company

Description

Helps users search for a company

Usage

search_company(char_to_search, cache_folder = "gfred_cache")

Arguments

char_to_search

Character for partial matching

cache_folder

Path of cache folder to keep cache, raw zip files, and parsed RDS files (default = 'gfred_cache').

Value

A dataframe with companies

Examples

## Not run:  # dontrun: keep cran check fast
df <- search_company('petrobras')

## End(Not run)