Code Monkey home page Code Monkey logo

meedr's People

Contributors

schoulten avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

ronaldosc

meedr's Issues

Mudança da API de expectativas da Selic de 'Mensal' para 'Reunião'

Descrição do problema

Usuário do {meedr} reportou, em canal externo, que não consegue obter os dados de expectativas mensais do indicador "Selic" usando get_monthly(). Os dados terminam em 2005, conforme abaixo, sendo que o usuário esperava observações até datas mais recentes.

Diagnóstico

Parece que houve uma mudança na API de Expectativas de Mercado do BCB — aparentemente não documentada aqui — utilizada pelo pacote. Os dados de expectativas mensais do indicador "Selic" foram descontinuados do recurso "ExpectativaMercadoMensais" e foi criado um novo recurso "ExpectativasMercadoSelic" na API.

Isso vai requerer a criação de uma nova função na estrutura atual do pacote, algo como get_selic(), para consumir os dados desse novo recurso, mantendo-se get_monthly() inalterada.

Exemplo reprodutível

library(meedr)

dados <- get_monthly(
  indicator = "Selic",
  first_date = NULL, 
  use_memoise = FALSE
  )
#> 
#> Fetching [Selic] data from BCB-Olinda...
#> 
#> Found 12514 observations!
dados
#> # A tibble: 12,514 × 10
#>    indicator date       reference_date  mean median    sd   min   max
#>    <chr>     <date>     <chr>          <dbl>  <dbl> <dbl> <dbl> <dbl>
#>  1 Selic     2005-12-14 12/2005         17.9     18  0.13  17.5  18.2
#>  2 Selic     2005-12-13 12/2005         17.9     18  0.13  17.5  18.2
#>  3 Selic     2005-12-12 12/2005         17.9     18  0.13  17.5  18.2
#>  4 Selic     2005-12-09 12/2005         17.9     18  0.14  17.5  18.2
#>  5 Selic     2005-12-08 12/2005         17.9     18  0.14  17.5  18.2
#>  6 Selic     2005-12-07 12/2005         17.9     18  0.13  17.5  18  
#>  7 Selic     2005-12-06 12/2005         17.9     18  0.16  17.2  18  
#>  8 Selic     2005-12-05 12/2005         17.9     18  0.16  17.2  18  
#>  9 Selic     2005-12-02 12/2005         17.9     18  0.16  17.2  18.2
#> 10 Selic     2005-12-01 12/2005         17.9     18  0.16  17.2  18.2
#> # … with 12,504 more rows, and 2 more variables: n_respondents <lgl>,
#> #   basis <int>

min(dados$date)
#> [1] "2001-11-06"
max(dados$date)
#> [1] "2005-12-14"

Created on 2022-08-12 by the reprex package (v2.0.1)

Session info
sessionInfo()
#> R version 4.2.0 (2022-04-22 ucrt)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 19043)
#> 
#> Matrix products: default
#> 
#> locale:
#> [1] LC_COLLATE=Portuguese_Brazil.utf8  LC_CTYPE=Portuguese_Brazil.utf8   
#> [3] LC_MONETARY=Portuguese_Brazil.utf8 LC_NUMERIC=C                      
#> [5] LC_TIME=Portuguese_Brazil.utf8    
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] meedr_0.0.3
#> 
#> loaded via a namespace (and not attached):
#>  [1] pillar_1.7.0      compiler_4.2.0    highr_0.9         R.methodsS3_1.8.1
#>  [5] R.utils_2.11.0    tools_4.2.0       digest_0.6.29     jsonlite_1.8.0   
#>  [9] evaluate_0.15     lifecycle_1.0.1   tibble_3.1.7      R.cache_0.15.0   
#> [13] pkgconfig_2.0.3   rlang_1.0.4       reprex_2.0.1      DBI_1.1.2        
#> [17] cli_3.3.0         rstudioapi_0.13   curl_4.3.2        yaml_2.3.5       
#> [21] xfun_0.31         fastmap_1.1.0     dplyr_1.0.9       withr_2.5.0      
#> [25] styler_1.7.0      stringr_1.4.0     httr_1.4.3        knitr_1.39       
#> [29] generics_0.1.3    fs_1.5.2          vctrs_0.4.1       tidyselect_1.1.2 
#> [33] glue_1.6.2        R6_2.5.1          fansi_1.0.3       rmarkdown_2.14   
#> [37] purrr_0.3.4       magrittr_2.0.3    ellipsis_0.3.2    htmltools_0.5.2  
#> [41] assertthat_0.2.1  utf8_1.2.2        stringi_1.7.8     crayon_1.5.1     
#> [45] R.oo_1.24.0

Two suggestions for the future code

Hi, congrats to you CRAN submission.

Just two quick comments as author of future here. Instead of:

used_workers <- formals_parallel$workers

use

used_workers <- future::nbrOfWorkers()

and instead of:

msg <- utils::capture.output(future::plan())
flag <- grepl("sequential", msg)[1]

use

flag <- inherits(future::plan(), "sequential")

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.