gshs-ornl / wbstats

wbstats: An R package for searching and downloading data from the World Bank API
http://gshs-ornl.github.io/wbstats/
Other
127 stars 23 forks source link

error in wb_data() with return_wide=FALSE and mrnev=1 #21

Closed greg-minshall closed 4 years ago

greg-minshall commented 4 years ago

i tried a small permutation or two from the (online!) vignette:

> gdp_capita <- wb_data("NY.GDP.PCAP.CD", mrv = 1)
> gdp_capita <- wb_data("NY.GDP.PCAP.CD", mrnev = 1)
> gdp_capita <- wb_data("NY.GDP.PCAP.CD", return_wide=FALSE, mrv = 1)
> gdp_capita <- wb_data("NY.GDP.PCAP.CD", return_wide=FALSE, mrnev = 1)
Error: Can't subset columns that don't exist.
✖ Column `unit` doesn't exist.
Run `rlang::last_error()` to see where the error occurred.
jpiburn commented 4 years ago

good catch! Depending on what combination of parameters you have the API returns different fields, I must not have caught that one.

Thank you for trying things out and posting your feedback. It's extremely helpful!

denironyx commented 4 years ago

It appears wb_data function is depreciated and the wb function is being used instead.

jpiburn commented 4 years ago

This bug is now fixed in the latest release, v1.0.1 which is now available on CRAN