Package {GetFREData}


Title: Reading FRE Corporate Data of Public Traded Companies from B3
Version: 1.1.0
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/.
Depends: R (≥ 4.1.0)
Imports: stringr, xml2, dplyr, readr, lubridate, purrr, rvest, GetDFPData2, utils, cli, fs, glue, janitor, lifecycle
ByteCompile: true
Encoding: UTF-8
License: GPL-2
BugReports: https://github.com/msperlin/GetFREData/issues
URL: https://github.com/msperlin/GetFREData/
Suggests: knitr, rmarkdown, testthat (≥ 3.0.0), ggplot2
VignetteBuilder: knitr
Config/testthat/edition: 3
Config/roxygen2/version: 8.1.0
NeedsCompilation: no
Packaged: 2026-08-29 11:11:21 UTC; msperlin
Author: Marcelo Perlin [aut, cre], Guilherme Kirch [aut]
Maintainer: Marcelo Perlin <marceloperlin@gmail.com>
Repository: CRAN
Date/Publication: 2026-08-29 11:30:02 UTC

GetFREData: 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/.

Author(s)

Maintainer: Marcelo Perlin marceloperlin@gmail.com

Authors:

See Also

Useful links:


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:

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.

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)