-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ano 2021 faltante #9
Comments
Rodei este código: rm(list = ls()) E apareceu isto: |
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"
)
The text was updated successfully, but these errors were encountered: