povcalnet_cl Facilitate interaction with the PovcalNet API. All parameters are specified at the country level (hence the _cl suffix), so if you send a request for two countries, you must also pass two values to the `year` argument, two values to the `povline` argument, etc.

povcalnet_cl(
  country,
  povline,
  year,
  coverage = NULL,
  ppp = NULL,
  url = "http://iresearch.worldbank.org",
  format = "csv"
)

Arguments

country

character: list of country iso3 code (accepts multiple). Use povcalnet_info for full list of countries.

povline

numeric: poverty line (in 2011 PPP-adjusted USD) to calculate poverty measures

year

numeric: list of years, or `all`, or `last`.

coverage

character: Can take one of three values: `national`, `urban`, `rural`

ppp

numeric: Optional - Allows the selection of custom PPP (Purchasing Power Parity) exchange rates

url

character: API root URL. For testing purposes only, should not be changed for 99 percent of users.

format

character: Response format to be requested from the API: `csv` or `json`

Value

data.frame

Examples

# \donttest{ povcalnet_cl(country = c("ALB", "USA"), povline = c(3.2, 5.5), year = c(2012, 2010))
#> # A tibble: 2 x 31 #> countrycode countryname regioncode coveragetype year datayear datatype #> <chr> <chr> <chr> <chr> <dbl> <dbl> <chr> #> 1 ALB Albania ECA N 2012 2012 consump~ #> 2 USA United Sta~ OHI N 2010 2010 income #> # ... with 24 more variables: isinterpolated <dbl>, usemicrodata <dbl>, #> # ppp <dbl>, povertyline <dbl>, mean <dbl>, headcount <dbl>, #> # povertygap <dbl>, povertygapsq <dbl>, watts <dbl>, gini <dbl>, #> # median <dbl>, mld <dbl>, polarization <dbl>, population <dbl>, #> # decile1 <dbl>, decile2 <dbl>, decile3 <dbl>, decile4 <dbl>, decile5 <dbl>, #> # decile6 <dbl>, decile7 <dbl>, decile8 <dbl>, decile9 <dbl>, decile10 <dbl>
# }