Get poverty and inequality statistics
get_stats(
country = "all",
year = "all",
povline = NULL,
popshare = NULL,
fill_gaps = FALSE,
nowcast = 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("arrow", "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
)
get_agg(
year = "all",
povline = NULL,
version = NULL,
ppp_version = NULL,
release_version = NULL,
aggregate = NULL,
api_version = "v1",
format = c("rds", "json", "csv"),
simplify = TRUE,
server = NULL
)Uppercase, three-letter country ISO codes or "all".
Integer-valued numeric years, "all", or "MRV" (most recent
value). Character strings containing years are not accepted.
One finite, non-negative numeric poverty line, or NULL.
Ignored when popshare is supplied.
One numeric population share from 0 to 1, or NULL.
One non-missing logical value. If TRUE, interpolate or
extrapolate missing years. Also enabled by nowcast = TRUE.
One non-missing logical value. If TRUE, return nowcast
estimates and enable fill_gaps.
NULL, "wb_regions", or "none". A non-NULL value uses
the grouped endpoint and disables gap filling and nowcasting.
character: Welfare type either of c("all", "income", "consumption")
character: Geographical reporting level either of c("all", "national", "urban", "rural")
Data version in YYYYMMDD_PPP_XX_YY_IDENTITY format, or
NULL. See get_versions().
One integer-valued numeric PPP year, a four-digit year
string, or NULL.
A valid publication date in YYYYMMDD format, or
NULL.
API version. Currently only "v1" is supported.
Response format: "arrow", "rds", "json", or "csv" for
get_stats(). get_wb() and get_agg() accept "rds", "json", or
"csv".
One non-missing logical value. If TRUE (the default),
return simplified data.
One non-empty server name, or NULL for the production server.
For World Bank internal use only.
Aggregate name. See get_aux("country_list") for available
options.
A tibble of statistics when simplify = TRUE, or a pip_api list
when simplify = FALSE.
if (interactive()) {
# 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_regions")
# Short hand to get WB global/regional stats
res <- get_wb()
# Short hand to get fcv stats
res <- get_agg(aggregate = "fcv")
# Custom aggregates
res <- get_stats(c("ARG", "BRA"), year = "all", subgroup = "none")
}