imfr icon indicating copy to clipboard operation
imfr copied to clipboard

problem with imf_ids

Open JulianVeit opened this issue 2 years ago • 3 comments

Hey!

I first tried to get data via the IMFData package and few days ago it worked perfectly fine but now I have a error message when trying to request the data. That is why I then tried the 'imfr' package. I downloaded it from the CRAN archive by using

library(devtools) install_url('https://cran.r-project.org/src/contrib/Archive/imfr/imfr_0.1.9.1.tar.gz')

When requesting the list of database_IDs with

library(imfr) imf_ids(return_raw = FALSE, times = 3)

Error in curl::curl_fetch_memory(url, handle = handle): Recv failure: Connection was reset Request failed [ERROR]. Retrying in 1.9 seconds... Error in curl::curl_fetch_memory(url, handle = handle): Recv failure: Connection was reset Request failed [ERROR]. Retrying in 2.8 seconds... Error in curl::curl_fetch_memory(url, handle = handle) : Recv failure: Connection was reset

then a very similar error message appears as when using the IMFData package.

Any advise on how to fix this or comment is appreciated a lot!

Best regards

Julian

JulianVeit avatar Oct 10 '22 14:10 JulianVeit

I got the error too, but eventually it worked...

imf_ids(return_raw = FALSE, times = 3)
#> Error in curl::curl_fetch_memory(url, handle = handle): Operation was aborted by an application callback
#> Request failed [ERROR]. Retrying in 1.1 seconds...
#>   |=========================================================================================================| 100%
#> # A data frame: 259 × 2
#>    database_id   description                                                                                       
#>  * <chr>         <chr>                                                                                             
#>  1 BOP_2017M06   Balance of Payments (BOP), 2017 M06                                                               
#>  2 BOP_2020M3    Balance of Payments (BOP), 2020 M03                                                               
#>  3 BOP_2017M11   Balance of Payments (BOP), 2017 M11                                                               
#>  4 DOT_2020Q1    Direction of Trade Statistics (DOTS), 2020 Q1                                                     
#>  5 GFSMAB2016    Government Finance Statistics Yearbook (GFSY 2016), Main Aggregates and Balances                  
#>  6 BOP_2019M12   Balance of Payments (BOP), 2019 M12                                                               
#>  7 GFSYFALCS2014 Government Finance Statistics Yearbook (GFSY 2014), Financial Assets and Liabilities by Counterpa…
#>  8 GFSE2016      Government Finance Statistics Yearbook (GFSY 2016), Expense                                       
#>  9 FM201510      Fiscal Monitor (FM) October 2015                                                                  
#> 10 GFSIBS2016    Government Finance Statistics Yearbook (GFSY 2016), Integrated Balance Sheet (Stock Positions and…
#> # … with 249 more rows
#> # ℹ Use `print(n = ...)` to see more rows

Seems like IMF's server is having trouble responding today.

FYI... both of the IMF packages appear to be "abandoned", meaning the primary developer/s and/or the people that have admin access to the repos have not been active here/there in quite some time, which is why they both have been archived and removed from CRAN, because the maintainers have not responded to requests from CRAN.

cjyetman avatar Oct 10 '22 16:10 cjyetman

Ok thanks a lot for your response, you are helping me out a lot!

Also thanks for the info about the packages. I was wondering how it could be that there seems to be no up-to-date / active package for retrieving data from IMF into R. It seems to me that there should be many people who need exactly a package like this. Do you know how most people actually get the data from IMF into R, people who are working in research institutes etc. ? Are they still relying on this "old" or at least not maintained packages or is there a common / convenient alternative? Or is everyone coding the API requests themselves?

Would be very thankful for any comment on this!

Best Julian

JulianVeit avatar Oct 10 '22 20:10 JulianVeit

Can't speak for anyone else, but I have mainly accessed their JSON API directly

cjyetman avatar Oct 11 '22 01:10 cjyetman