list_supported_indicators: List all supported World Bank indicators

View source: R/list_supported_indicators.R

list_supported_indicatorsR Documentation

List all supported World Bank indicators

Description

This function retrieves a comprehensive list of all indicators supported by the World Bank API. The indicators include metadata such as the indicator ID, name, unit, source, and associated topics. The user can specify the language of the API response and whether to include additional details.

Usage

list_supported_indicators(
  language = "en",
  per_page = 32500,
  include_details = FALSE,
  progress = TRUE
)

Arguments

language

A character string specifying the language for the request, see list_supported_languages. Defaults to "en".

per_page

An integer specifying the number of results per page for the API. Defaults to 32,500. Must be a value between 1 and 32,500.

include_details

A logical value indicating whether to include additional details such as unit and topics in the result. When FALSE, only basic information (ID, name, source) is returned. Defaults to FALSE.

progress

A logical value indicating whether to show progress messages during the data parsing process. Defaults to TRUE.

Details

This function makes a request to the World Bank API to retrieve metadata for all available indicators. It processes the response into a tidy tibble format. If the include_details parameter is FALSE, the result will only include basic indicator information (ID, name, source note, and organization). If include_details is TRUE, additional metadata such as the indicator's unit, source ID and value, and associated topics will be included.

If the progress parameter is set to TRUE, messages will be displayed during the request and parsing process.

Value

A tibble containing the available indicators and their metadata. Depending on the value of include_details, the tibble includes the following columns:

indicator_id

The ID of the indicator (e.g., "NY.GDP.PCAP.KD").

indicator_name

The name of the indicator (e.g., "GDP per capita, constant prices").

unit

The unit of measurement for the indicator, if available (e.g., "US Dollars"). Included only if include_details = TRUE.

source_id

The ID of the data source providing the indicator. Included only if include_details = TRUE.

source_value

The name or description of the source of the indicator data. Included only if include_details = TRUE.

source_note

Additional notes or descriptions about the data source.

source_organization

The organization responsible for the data source.

topics

A nested tibble containing topics associated with the indicator, with two columns: topic_id and topic_value. Included only if include_details = TRUE.

Examples


# List all supported indicators in English
list_supported_indicators(language = "en")

# List all supported indicators in Spanish
list_supported_indicators(language = "es", include_details = TRUE)


wdi2 documentation built on Sept. 13, 2024, 1:12 a.m.