get_dfp_data: Downloads and reads DFP datasets

View source: R/fct_get_dfp_data.R

get_dfp_dataR Documentation

Downloads and reads DFP datasets

Description

The DFP (demonstrativos financeiros padronizados) is the annual reporting system of companies traded at B3. This function will access the CVM ftp and parse all available files according to user choices

Usage

get_dfp_data(
  companies_cvm_codes = NULL,
  first_year = 2010,
  last_year = lubridate::year(Sys.Date()),
  type_docs = c("BPA", "BPP", "DRE"),
  type_format = c("con", "ind"),
  clean_data = TRUE,
  use_memoise = FALSE,
  cache_folder = "gdfpd2_cache",
  do_shiny_progress = FALSE
)

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

type_docs

Type of financial documents. E.g. c('DRE', 'BPA'). Definitions: '*' = fetch all docs, 'BPA' = Assets (ativos), 'BPP' = Liabilities (passivo), 'DRE' = income statement (demonstrativo de resultados), 'DFC_MD' = cash flow by direct method (fluxo de caixa pelo metodo direto), 'DFC_MI' = cash flow by indirect method (fluxo de caixa pelo metodo indireto), 'DMPL' = statement of changes in equity (mutacoes do patrimonio liquido), 'DVA' = value added report (desmonstrativo de valor agregado)

type_format

Type of format of document (con = consolidated, ind = individual). Default = c('con', 'ind')

clean_data

Clean data or return raw data? See read_dfp|itr_csv() for details

use_memoise

Use memoise caching? If no (default), the function will read all .csv files. If yes, will use package memoise for caching results (execution speed increases significantly)

cache_folder

Path of cache folder to keep memoise and zip files

do_shiny_progress

Whether to use shiny progress indicator (default = FALSE)

Value

A list of tibbles containing all requested financial data. Each element of the list is a table from DFP.

Examples

## Not run: 
df_dfp <- get_dfp_data(companies_cvm_codes = NULL)

## End(Not run)

GetDFPData2 documentation built on April 25, 2023, 5:11 p.m.