christophergandrud / christophergandrud/imfr
Problems with Global Financial Statistics
- Dominant language
- R
- Stars
- 48
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Hello there,
I am trying to find some pretty simple data from the Global Financial Statistics: debt-to-GDP ratios for all countries. Having run `imf_parameters` on the GFSMAB (main aggregates and balances) dataset, I think this query should do what I want:
````
imf_dataset(database_id = "GFSMAB",
freq = "A",
unit_measure = "XDC_R_B1GQ",
ref_sector = "S13",
classification = "G63_F3T4")
````
However, it fails with the following error:
````
Error in `map()`:
ℹ In index: 1.
Caused by error in `` names(df) <- `*vtmp*` ``:
! attempt to set an attribute on NULL
````
If I exclude both `unit_measure` and `ref_sector` then the query compiles, but the API call itself fails:
````
Request failed [500]. Retrying in 9.8 seconds...
Error in fun(URL = "http://dataservices.imf.org/REST/SDMX_JSON.svc/CompactData/GFSMAB/A....G63_F3T4", :
API request failed. Status: '500', Content: 'There is an issue while retrieving the data, please check your query or contact an administrator.'
````
Having clicked around [the IMF website](https://data.imf.org/?sk=c4f7655e-bd37-4683-8685-b7aa1818a832&sid=1437417898397), this GSF data seems pretty patchy anyway, but I don't think that explains these errors. Any help would be much appreciated.
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue with imf_parameters and the shown imf_dataset call for GFSMAB, then compare it with the query that omits unit_measure and ref_sector. Inspect the resulting API request and response to determine whether the failure is in query handling or the IMF endpoint; done means the reported query works or fails with a useful, explained error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- api, data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100