Git Product home page Git Product logo

getdfpdata2's Introduction

About me

I'm an associate professor of Finance at EA/UFRGS.

You can find more details about my work at my personal site.

Fell free to reach me at [email protected].

getdfpdata2's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

getdfpdata2's Issues

Ticker das empresas - GetDFPData2

Marcelo, sabe se é possível obter o ticker das empresas através do get_info_companies? Aparentemente o ticker das empresas não fica disponível na tabela gerada

Abraço

Bug quando vai pegar mais de um demontrativo

Quando realizo o código para pegar os DRE do ano "x" ao "y" ele baixa os arquivos gerais do ano "x" ao "y" na pasta "gdfpd2_cache".

Quando em sequencia peço para baixar os BPA de uma empresa por exemplo ele da o erro a seguir:

File already existsError in if (dl_size == current_size) { :
missing value where TRUE/FALSE needed

Então tenho que limpar para baixar de novo, sendo que anteriormente (em versões mais antigas), o código pegava o arquivo já se ele tivesse baixado automaticamente

get_info_companies() not returning companies tickers

@msperlin Hi Professor,
Thank you so much for this package, its amazing.

Yet, I'm not being able to retrieve a list of tickers of Brazilian companies from the DF 'get_info_companies()'.
The list downloaded from cvm does not have a column covering the tickers itself.

Can you please help me?

Erro no get_info_company

Oi Professor!
Tentei rodar os seguintes comandos no R:

df_info <- get_info_companies()
df_info <- get_info_companies(tempdir())

Ambos com o erro:

Fetching info on B3 companies
Dowloading file from CVM
File not found, downloading it..
sh: wget: command not found
Error in utils::download.file(url = dl_link, destfile = dest_file, method = "wget", :
'wget' call had nonzero exit status
In addition: Warning message:
In system(paste("wget", paste(extra, collapse = " "), shQuote(url), :
error in running command
Error in if (file.size(dest_file) < 10) { :
missing value where TRUE/FALSE needed

Issue with cvm_code = 22179

df_dfp <- get_dfp_data(companies_cvm_codes = 22179,
clean_data = TRUE,
use_memoise = FALSE,
first_year = 2010,
last_year = 2020,
type_docs = c('DRE', 'BPA', 'BPP', "DFC_MI"), # income, assets, liabilities
type_format = 'con') # consolidated statements

__

Error: Can't combine ..1$DT_INI_EXERC and ..2$DT_INI_EXERC .
Run rlang::last_error() to see where the error occurred.

Acesso ao shiny

Bom dia professor, poderia por gentileza informar se há um acesso correto ao link do shiny (versão web do GetDFPData2)? Tento acessar pelo link do blog, porém aparece uma mensagem "Page not found". Link é esse: https://msperlin.com/shiny/GetDFPData

Obrigado desde já

Erro no get_dfp_data

Ao executar a função get_dfp_data obtenho o seguinte erro:

Error in read_xml.raw(raw, encoding = encoding, base_url = base_url, as_html = as_html, :
Failed to parse text

código executado:
l.dfp <- get_dfp_data(companies_cvm_codes = 20990,
use_memoise = FALSE,
clean_data = TRUE,
type_docs = c('BPA', 'BPP', 'DRE', 'DFC_MI'),
type_format = 'con',
first_year = 2015,
last_year = 2020)

Erro em DRE

if (!require(GetDFPData2)) devtools::install_github('msperlin/GetDFPData2') # not in CRAN yet
library(dplyr)

df_itr <- get_itr_data(companies_cvm_codes = NULL,
first_year = 2010,
last_year = 2011,
type_docs = c('DRE', 'BPA', 'BPP','DFC_MI','DFC_MD')
)

E obtenho o seguinte erro:

Downloading DRE
Error in open.connection(x, "rb") : HTTP error 404.

Ano 2021 faltante

Olá, professor.
Baixei os dados de Cosan desde 2010, mas não veio o ano de 2021.
O que está acontecendo?

Código abaixo:

rm(list = ls())
graphics.off()
if (!require("pacman")) install.packages("pacman")
p_load(
GetDFPData2,
tidyverse,
janitor,
here,
lubridate,
tiqyquant
)
select_company <- "cosan"
data_search <-
search_company(select_company) |>
as_tibble() |>
clean_names() |>
filter(sit_reg == "ATIVO")
company_code <-
data_search |>
pull(cd_cvm)
first_year <- 2010
income <-
get_dfp_data(
companies_cvm_codes = company_code,
type_docs = "DRE",
type_format = "con",
first_year = first_year,
last_year = year(Sys.Date())
) |>
pluck(1) |>
clean_names()
select_income <- c(
"Receita de Venda de Bens e/ou Serviços",
"Resultado Bruto",
"Resultado Antes do Resultado Financeiro e dos Tributos",
"Lucro/Prejuízo Consolidado do Período",
)
income_subset <-
income |>
select(
date_start = dt_ini_exerc,
index = cd_conta,
item = ds_conta,
value = vl_conta
) |>
filter(item %in% select_income)
income_subset |>
filter(str_detect(item, "Receita")) |>
tq_mutate(
select = value,
mutate_fun = periodReturn,
period = "annually",
col_rename = "return"
)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.