list_supported_countries: List all supported countries and regions from the World Bank...

View source: R/list_supported_countries.R

list_supported_countriesR Documentation

List all supported countries and regions from the World Bank API

Description

This function retrieves and processes a list of all countries supported by the World Bank API, along with metadata such as region, administrative region, income level, and lending type. The user can specify the language of the API response.

Usage

list_supported_countries(language = "en", per_page = 1000)

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 1000. Must be a value between 1 and 32,500.

Details

This function sends a request to the World Bank API to retrieve data for all supported countries in the specified language. The data is then processed into a tidy format and includes information about the country, such as its ISO code, capital city, geographical coordinates, and additional nested metadata about regions, income levels, and lending types.

Value

A tibble containing country information along with associated metadata. The tibble includes the following columns:

id

The identifier for the country.

iso2_code

The ISO 2-character country code.

name

The full name of the country.

capital_city

The capital city of the country.

longitude

The longitude of the country.

latitude

The latitude of the country.

regions

A nested tibble containing information about the region the country belongs to.

admin_regions

A nested tibble containing information about the administrative region the country belongs to.

income_levels

A nested tibble containing information about the income level classification of the country.

lending_types

A nested tibble containing information about the lending type classification of the country.

Examples

# List all supported countries in English
list_supported_countries(language = "en")

# List all supported countries in Spanish
list_supported_countries(language = "zh")


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