Nothing
NOT_CRAN <- identical(tolower(Sys.getenv("NOT_CRAN")), "true") knitr::opts_chunk$set( collapse = TRUE, comment = "#>", purl = NOT_CRAN )
library(povcalnetR)
The povcalnetR
package allows to easily query the PovcalNet API from R.
Here are a few examples to get you started:
By default, the povcalnet
function return all available
povcalnet()
# Specify ONE country povcalnet(country = "ALB") # Specify MULTIPLE countries povcalnet(country = c("ALB", "CHN"))
By default, povcalnet
will only return data if a survey is available for the
requested country and the requested year
# Survey year NOT available povcalnet(country = "ALB", year = 2012) # Survey year NOT available - Empty response povcalnet(country = "ALB", year = 2018)
povcalnet(country = "ALB", povline = 3.2)
The fill_gaps
argument will trigger the interpolation / extrapolation of
poverty estimates when survey year is not available
# fill_gaps = FALSE (default) povcalnet(country = "HTI") # fill_gaps = TRUE povcalnet(country = "HTI", fill_gaps = TRUE)
The povcalnet
function can also be used to compute aggregate welfare statistics
of custom group of countries
# World aggregate povcalnet(country = "all", aggregate = TRUE) # Custom aggregate povcalnet(country = c("CHL", "ARG", "BOL"), aggregate = TRUE)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.