christophergandrud / christophergandrud/imfr
Fiscal Monitor Data now only provides the URL, not the full dataset?
- Dominant language
- R
- Stars
- 48
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I was recently using this package to pull the FM dataset.
The output is no longer a nested list with a dataframe, but rather a list with URLs in it. Could you let me know if I'm doing something wrong, or is this a known issue with the Fiscal Monitor data?
Thanks so much for your time and for creating this package!
```
library(imfr) # To access IMF data API
library(magrittr)
library(tidyr)
library(data.table)
library(countrycode)
imf_databases$description %>% grep("fiscal monitor", .,
ignore.case = T,
value = T)
imf_databases <- imf_ids() %>% as.data.table()
database_id_val <-
imf_databases[description == "Fiscal Monitor (FM)"]$database_id
codelist <-
imf_codelist(database_id = database_id_val) %>% as.data.table()
codelist_val <-
codelist[description == "Geographical Areas"]$codelist
indicator_val <-
codelist[description == "Indicator"]$codelist
AREA_codes <-
imf_codes(codelist = codelist_val) %>% as.data.table()
INDICATOR_codes <-
imf_codes(codelist = indicator_val) %>% as.data.table()
data(codelist)
country_set <- codelist
country_set <- country_set %>%
select(country.name.en , iso2c, iso3c, imf, continent, region) %>%
filter(!is.na(imf) &
!is.na(iso2c))
iso2_vec <- country_set$iso2c
# Fiscal monitor data
fm_ls <- list()
start_num <- 1
end_index <- start_num + 49
while (end_index < length(iso2_vec)) {
end_index <- min(start_num + 49, length(iso2_vec))
fm_ls[as.character(start_num)] <-
imf_data(
database_id = "FM" ,
country = iso2_vec[start_num:end_index],
start = 2010,
end = current_year(),
return_raw = TRUE,
indicator = "All_indicators"
)
start_num <- start_num + 50
}
fm_ls
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running the supplied R example and inspect the imf_data() call for the Fiscal Monitor database, especially the return_raw behavior and the values returned by the IMF API. Compare the current URL-only result with the package's documented dataset structure; done means the behavior is explained and, if it is a package regression, the expected dataset is returned or the limitation is documented.
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
- Needs clarification
- Newbie friendliness
- 25/100