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

named vector renames indicators automatically #12

Closed vincentarelbundock closed 4 years ago

vincentarelbundock commented 5 years ago

I've gotten good feedback from users on this feature and I use it all the time myself. Would be nice to see implemented here:

library(WDI)
ind = c("gdp_per_capita" = "NY.GDP.PCAP.KD",
        "population" = "SP.POP.TOTL")
dat = WDI(indicator = ind)
head(dat)
iso2c    country year gdp_per_capita population
1    1A Arab World 2005       5378.379  316264728
2    1A Arab World 2006       5594.899  323773264
3    1A Arab World 2007       5711.663  331653797
4    1A Arab World 2008       5898.516  339825483
5    1A Arab World 2009       5782.422  348145094
6    1A Arab World 2010       5916.330  356508908
jpiburn commented 5 years ago

Great Idea! That does seem very useful. I'll try to get that in soon

jpiburn commented 4 years ago

Implemented as of version 1.0. Thanks again for the suggestion