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 <http://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: 0.8.2
Built: 2024-11-08 04:28:17 UTC
Source: https://github.com/msperlin/getfredata

Help Index


Reads folder for zip file post 2011 (internal)

Description

Reads folder for zip file post 2011 (internal)

Usage

gdfpd.read.zip.file.type.fre(rnd_folder_name, folder_to_unzip = tempdir())

Arguments

rnd_folder_name

Folder name where unzipped files are available

folder_to_unzip

Folder to unzip files

Value

A list with financial statements

Examples

# no example (this functions not used directly)

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_data(
  companies_cvm_codes = NULL,
  first_year = lubridate::year(Sys.Date()) - 2,
  last_year = lubridate::year(Sys.Date()),
  fre_to_read = "last",
  cache_folder = "gfred_cache"
)

Arguments

companies_cvm_codes

Numeric CVM code of companies. IF set to NULL (default), will return data for all available companies.

first_year

First year of selected data

last_year

Last year of selected data

fre_to_read

Whether to read 'first', 'last' or 'all' fre docs ('last' is default). Be aware that companies do release several FRE docs for a single year.

cache_folder

Path of cache folder to keep cache and zip files

Value

A list of tibbles, where each element is a different table from the FRE system

Examples

## Not run: 
l_fre <- get_fre_data(18627)

## End(Not run)

Returns a up to date table with information about B3 companies

Description

Imports a dataset from cvm <http://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 and zip files

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)

Manipulates list from FRE zip file

Description

This function will add several columns to each table in fre list.

Usage

my_fix_cols(df_in, df_info_file)

Arguments

df_in

Entry dataframe

df_info_file

Informations about file

Value

An organized dataframe

Examples

## Not run: 
# no example here

## 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 and zip files

Value

A dataframe with companies

Examples

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

## End(Not run)