get_aux() gets an auxiliary dataset. If no table is specified, it lists the available tables.

Use get_aux("countries") for a table of country names, ISO codes, and associated region codes.

get_aux(
  table = NULL,
  version = NULL,
  ppp_version = NULL,
  release_version = NULL,
  api_version = "v1",
  format = c("rds", "json", "csv"),
  simplify = TRUE,
  server = NULL,
  assign_tb = FALSE,
  replace = FALSE
)

get_countries(
  version = NULL,
  ppp_version = NULL,
  release_version = NULL,
  api_version = "v1",
  format = c("rds", "json", "csv"),
  server = NULL
)

get_regions(
  version = NULL,
  ppp_version = NULL,
  release_version = NULL,
  api_version = "v1",
  format = c("rds", "json", "csv"),
  server = NULL
)

get_cpi(
  version = NULL,
  ppp_version = NULL,
  release_version = NULL,
  api_version = "v1",
  format = c("rds", "json", "csv"),
  server = NULL
)

get_dictionary(
  version = NULL,
  ppp_version = NULL,
  release_version = NULL,
  api_version = "v1",
  format = c("rds", "json", "csv"),
  server = NULL
)

get_gdp(
  version = NULL,
  ppp_version = NULL,
  release_version = NULL,
  api_version = "v1",
  format = c("rds", "json", "csv"),
  server = NULL
)

get_incgrp_coverage(
  version = NULL,
  ppp_version = NULL,
  release_version = NULL,
  api_version = "v1",
  format = c("rds", "json", "csv"),
  server = NULL
)

get_interpolated_means(
  version = NULL,
  ppp_version = NULL,
  release_version = NULL,
  api_version = "v1",
  format = c("rds", "json", "csv"),
  server = NULL
)

get_hfce(
  version = NULL,
  ppp_version = NULL,
  release_version = NULL,
  api_version = "v1",
  format = c("rds", "json", "csv"),
  server = NULL
)

get_pop(
  version = NULL,
  ppp_version = NULL,
  release_version = NULL,
  api_version = "v1",
  format = c("rds", "json", "csv"),
  server = NULL
)

get_pop_region(
  version = NULL,
  ppp_version = NULL,
  release_version = NULL,
  api_version = "v1",
  format = c("rds", "json", "csv"),
  server = NULL
)

get_ppp(
  version = NULL,
  ppp_version = NULL,
  release_version = NULL,
  api_version = "v1",
  format = c("rds", "json", "csv"),
  server = NULL
)

get_region_coverage(
  version = NULL,
  ppp_version = NULL,
  release_version = NULL,
  api_version = "v1",
  format = c("rds", "json", "csv"),
  server = NULL
)

get_survey_means(
  version = NULL,
  ppp_version = NULL,
  release_version = NULL,
  api_version = "v1",
  format = c("rds", "json", "csv"),
  server = NULL
)

Arguments

table

Aux table

version

Data version in YYYYMMDD_PPP_XX_YY_IDENTITY format, or NULL. See get_versions().

ppp_version

Validated as a PPP year, but not sent to the auxiliary endpoint because this endpoint does not accept it.

release_version

A valid publication date in YYYYMMDD format, or NULL.

api_version

API version. Currently only "v1" is supported.

format

Response format: "rds", "json", or "csv".

simplify

One non-missing logical value. If TRUE (the default), return simplified data.

server

One non-empty server name, or NULL for the production server. For World Bank internal use only.

assign_tb

assigns table to specified name to the .pip environment. If FALSE no assignment will performed. If TRUE, the table will be assigned to exactly the same name as the one of the desired table. If character, the table will be assigned to that name.

replace

logical: force replacement of aux files in .pip env. Default is FALSE.

Value

With no table, invisibly returns the available tables (a tibble with a tables column by default). With a selected table, returns its tibble when simplify = TRUE, or a pip_api list when simplify = FALSE. With assign_tb = TRUE or a name, invisibly returns TRUE on successful assignment to .pip; unsuccessful assignment raises an error.

Functions

  • get_countries(): Returns a table countries with their full names, ISO codes, and associated region code

  • get_regions(): Returns a table regional grouping used for computing aggregate poverty statistics.

  • get_cpi(): Returns a table of Consumer Price Index (CPI) values used for poverty and inequality computations. statistics

  • get_dictionary(): Returns a data dictionary with a description of all variables available through the PIP API.

  • get_gdp(): Returns a table of Growth Domestic Product (GDP) values used for poverty and inequality statistics.

  • get_incgrp_coverage(): Returns a table of survey coverage for low and lower-middle income countries. If this coverage is less than 50%, World level aggregate statistics will not be computed.

  • get_interpolated_means(): Returns a table of key information and statistics for all years for which poverty and inequality statistics are either available (household survey exists) or extra- / interpolated. Please see get_aux("dictionary") for more information about each variable in this table.

  • get_hfce(): Returns a table of Household Final Consumption Expenditure (HFCE) values used for poverty and inequality computations.

  • get_pop(): Returns a table of population values used for poverty and inequality computations.

  • get_pop_region(): Returns a table of total population by region-year. These values are used for the computation of regional aggregate poverty statistics.

  • get_ppp(): Returns a table of Purchasing Power Parity (PPP) values used for poverty and inequality computations.

  • get_region_coverage(): Return a table of regional survey coverage: Percentage of available surveys for a specific region-year.

  • get_survey_means(): Returns a table of all available surveys and associated key statistics. See get_aux("dictionary") for more information about each variable in this table.

Examples

if (interactive()) {
# Get list of tables
x <- get_aux()

# Get GDP data
df <- get_aux("gdp")

# Get countries
df <- get_aux("countries")

# Display auxiliary tables
get_aux()

# Bind gdp table to "gdp" in .pip env
get_aux("gdp", assign_tb = TRUE)

# Bind gdp table to "new_name" in .pip env
get_aux("gdp", assign_tb = "new_name")

}
if (interactive()) {
# Short hand to get countries
get_aux("countries")
}
if (interactive()) {
# Short hand to get regions
get_aux("regions")
}
if (interactive()) {
# Short hand to get cpi
get_aux("cpi")
}
if (interactive()) {
# Short hand to get dictionary
get_aux("dictionary")
}
if (interactive()) {
# Short hand to get gdp
get_aux("gdp")
}
if (interactive()) {
# Short hand to get incgrp_coverage
get_aux("incgrp_coverage")
}
if (interactive()) {
# Short hand to get interpolated_means
get_aux("interpolated_means")
}
if (interactive()) {
# Short hand to get hfce
get_aux("pce")
}
if (interactive()) {
# Short hand to get pop
get_aux("pop")
}
if (interactive()) {
# Short hand to get pop_region
get_aux("pop_region")
}
if (interactive()) {
# Short hand to get ppp
get_aux("ppp")
}
if (interactive()) {
# Short hand to get region_coverage
get_aux("region_coverage")
}
if (interactive()) {
# Short hand to get survey_means
get_aux("survey_means")
}