Learn R Programming

WDI (version 2.4)

WDI: WDI: World Development Indicators (World Bank)

Description

Downloads the requested data by using the World Bank's API, parses the resulting JSON file, and formats it in long country-year format.

Usage

WDI(country = "all", indicator = "NY.GNS.ICTR.GN.ZS",
    start = 2005, end = 2011, extra = FALSE, cache = NULL)

Arguments

country

Vector of countries (ISO-2 character codes, e.g. "BR", "US", "CA") for which the data is needed. Using the string "all" instead of individual iso codes pulls data for every available country.

indicator

Character vector of indicators codes. See the WDIsearch() function.

start

First year of data

end

Last year of data

extra

TRUE returns extra variables such as region, iso3c code, and incomeLevel

cache

NULL (optional) a list created by WDIcache() to be used with the extra=TRUE argument

Value

Data frame with country-year observations

Examples

Run this code
# NOT RUN {
WDI(country="all", indicator=c("AG.AGR.TRAC.NO","TM.TAX.TCOM.BC.ZS"),
    start=1990, end=2000)
WDI(country=c("US","BR"), indicator="NY.GNS.ICTR.GN.ZS", start=1999, end=2000,
    extra=TRUE, cache=NULL)
# }

Run the code above in your browser using DataLab