christophergandrud / imfr

R package for interacting with the IMF RESTful JSON API
47 stars 5 forks source link

imf_data request fails #12

Open nreigl opened 6 years ago

nreigl commented 6 years ago

Running the example Simple Country-Time-Variable

library(imfr)

real_ex <- imf_data(database_id = 'IFS', indicator = 'EREER_IX',
                    country = c('CN', 'GB'), freq = 'A',
                    start = 2013, end = current_year())

I get

Downloading: 150 kB     Error: Unable to download series.

Windows sessionInfo()

R version 3.4.4 (2018-03-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=Estonian_Estonia.1257  LC_CTYPE=Estonian_Estonia.1257    LC_MONETARY=Estonian_Estonia.1257 LC_NUMERIC=C                     
[5] LC_TIME=Estonian_Estonia.1257    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] imfr_0.1.5

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.17     dplyr_0.7.5      assertthat_0.2.0 R6_2.2.2         jsonlite_1.5     magrittr_1.5     httr_1.3.1       pillar_1.2.3    
 [9] rlang_0.2.1      curl_3.2         bindrcpp_0.2.2   tools_3.4.4      glue_1.2.0       purrr_0.2.5      yaml_2.1.19      compiler_3.4.4  
[17] pkgconfig_2.0.1  bindr_0.1.1      tidyselect_0.2.4 tibble_1.4.2

Running the same code snippet on OSX gives the same error.

OSX sessionInfo()

R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.5

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] imfr_0.1.5

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.17     dplyr_0.7.5      assertthat_0.2.0 R6_2.2.2         jsonlite_1.5     magrittr_1.5     httr_1.3.1       pillar_1.2.3     rlang_0.2.1     
[10] curl_3.2         bindrcpp_0.2.2   tools_3.5.0      glue_1.2.0.9000  purrr_0.2.5      yaml_2.1.19      compiler_3.5.0   pkgconfig_2.0.1  bindr_0.1.1     
[19] knitr_1.20       tidyselect_0.2.4 tibble_1.4.2  
cjyetman commented 6 years ago

IMF's API has substantially changed. This package needs to be updated based on info found here: https://sdmxcentral.imf.org/rest-get.html

christophergandrud commented 5 years ago

I was unable to reproduce this problem.

library(imfr)
real_ex <- imf_data(database_id = 'IFS', indicator = 'EREER_IX',
                     country = c('CN', 'GB'), freq = 'A',
                     start = 2013, end = current_year())

real_ex

# iso2c year  EREER_IX
# 1     CN 2013 114.63856
# 2     CN 2014 118.34228
# 3     CN 2015 129.93152
# 4     CN 2016 123.62516
# 5     CN 2017 120.07204
# 6     CN 2018 121.68013
# 7     GB 2013 102.05529
# 8     GB 2014 108.71170
# 9     GB 2015 113.73749
# 10    GB 2016 102.36253
# 11    GB 2017  97.07482
# 12    GB 2018  98.82861
clemdmcl commented 3 years ago

Hi @christophergandrud,

Have you been able to solve your issue? I am having the same problem but the link provided by @cjyetman no longer exists. I downloaded the package yesterday and it worked fine. The problem Error: Unable to download series. only arose today. (I tried the same code as you). I updated the package by downloading it again, but without success.

christophergandrud commented 3 years ago

Thanks for raising the issues @clemdmcl

I was also just now not able to download the series:

library(imfr)
real_ex <- imf_data(database_id = 'IFS', indicator = 'EREER_IX',
                     country = c('CN', 'GB'), freq = 'A',
                     start = 2013, end = current_year())
Downloading: 150 kB     Error: Unable to download series.
Called from: download_parse(URL)
Browse[1]> 
real_ex
Error: object 'real_ex' not found
clemdmcl commented 3 years ago

Hi @christophergandrud,

thanks for checking, I dont know how this problem could be solved though