povcalnet Facilitate interaction with the PovcalNet API
povcalnet( country = "all", povline = 1.9, year = "all", aggregate = FALSE, fill_gaps = FALSE, coverage = "all", ppp = NULL, url = "http://iresearch.worldbank.org", format = "csv" )
country | character: list of country iso3 code (accepts multiple) or
`all`. Use |
---|---|
povline | numeric: poverty line (in 2011 PPP-adjusted USD) to calculate poverty measures |
year | numeric: list of years, or `all`. |
aggregate | logical: `TRUE` will return aggregate results, `FALSE` country-level results. |
fill_gaps | logical: `TRUE` will interpolate / extrapolate values when surveys are not available for a specific year. |
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` |
data.frame
# \donttest{ povcalnet(country = "ALB")#> # A tibble: 9 x 31 #> countrycode countryname regioncode coveragetype year datayear datatype #> <chr> <chr> <chr> <chr> <dbl> <dbl> <chr> #> 1 ALB Albania ECA N 1996 1996 consump~ #> 2 ALB Albania ECA N 2002 2002 consump~ #> 3 ALB Albania ECA N 2005 2005 consump~ #> 4 ALB Albania ECA N 2008 2008 consump~ #> 5 ALB Albania ECA N 2012 2012 consump~ #> 6 ALB Albania ECA N 2014 2014 consump~ #> 7 ALB Albania ECA N 2015 2015 consump~ #> 8 ALB Albania ECA N 2016 2016 consump~ #> 9 ALB Albania ECA N 2017 2017 consump~ #> # ... 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># }