Get poverty and inequality statistics
get_stats(
country = "all",
year = "all",
povline = NULL,
popshare = NULL,
fill_gaps = FALSE,
subgroup = NULL,
welfare_type = c("all", "income", "consumption"),
reporting_level = c("all", "national", "urban", "rural"),
version = NULL,
ppp_version = NULL,
release_version = NULL,
api_version = "v1",
format = c("rds", "json", "csv"),
simplify = TRUE,
server = NULL
)
get_wb(
year = "all",
povline = NULL,
version = NULL,
ppp_version = NULL,
release_version = NULL,
api_version = "v1",
format = c("rds", "json", "csv"),
simplify = TRUE,
server = NULL
)
character: A vector with one or more country ISO 3 codes or 'all'
integer: A vector with one or more years or 'all'
numeric: Poverty line
numeric: Proportion of the population living below the poverty line
logical: If TRUE, will interpolate / extrapolate values for missing years
character: If used result will be aggregated for predefined sub-groups. Either 'wb_regions' or 'none'.
character: Welfare type either of c("all", "income", "consumption")
character: Geographical reporting level either of c("all", "national", "urban", "rural")
character: Data version. See get_versions()
ppp year to be used
date when the data was published in YYYYMMDD format
character: API version
character: Response format either of c("rds", "json", "csv")
logical: If TRUE (the default) the response is returned as a
tibble
character: Server. For WB internal use only
If simplify = FALSE
, it returns a list of class "pip_api". If
simplify = TRUE
, it returns a tibble with the requested data. This is the
default. Only for get_aux()
, If assign_tb = TRUE
or character, it
returns TRUE when data was assign properly to .pip env. FALSE, if it was
not assigned.
if (FALSE) {
# One country-year
res <- get_stats(country = "AGO", year = 2000)
# All years for a specific country
res <- get_stats(country = "AGO", year = "all")
# All countries and years
res <- get_stats(country = "all", year = "all")
# All countries and years w/ alternative poverty line
res <- get_stats(country = "all", year = "all", povline = 3.2)
# Fill gaps for years without available survey data
res <- get_stats(country = "all", year = "all", fill_gaps = TRUE)
# Proportion living below the poverty line
res <- get_stats(country = "all", year = "all", popshare = .4)
# World Bank global and regional aggregates
res <- get_stats("all", year = "all", subgroup = "wb")
# Short hand to get WB global/regional stats
res <- get_wb()
# Custom aggregates
res <- get_stats(c("ARG", "BRA"), year = "all", subgroup = "none")
}