View source: R/get_mexico_population.R
get_mexico_population | R Documentation |
Retrieves Mexico's total population for the years 2010 to 2022 using the World Bank Open Data API. The indicator used is 'SP.POP.TOTL'.
get_mexico_population()
The function sends a GET request to the World Bank API. If the request fails or returns an error code, it will return 'NULL' with an informative message.
A tibble with the following columns:
Indicator name (e.g., "Population, total")
Country name ("Mexico")
Year of the data (integer)
Population as numeric value
Formatted population value (e.g., "126,705,138")
Requires internet connection. Data is retrieved in real time from the World Bank API.
GET, fromJSON, as_tibble, comma
if (interactive()) {
get_mexico_population()
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.