world_data: Obtaining countries' information

Description Usage Arguments Value Examples

View source: R/world_data.R

Description

This function returns a tibble comprising geo coordinates of each country with the iso2c and iso3c code, income and GDP per capita information, along with which continent each country is classified with. Sometimes, country names do not align well when joining various data together. For example, some data shows country as "USA", others have "The U.S." or "US", making the data join experience a pain. And this is where the iso2c and the iso3c codes come into play a key role in country name join, as they are the standard codes and can be unified. map_data("world") is useful when users want to make a world map, as it comprises geo coordinates of each country. This dataframe, however, is not a tibble, and it does not contain the iso2c or iso3c code, causing it a bit difficult to work with when joining it with other world data. The function world_data changes this situation by outputting a tibble that goes beyond map_data("world") by binding extra columns including the aforementioned ISO codes and others. The only argument users need to input is which year of country information they want to use, such as GDP per capita and the income category, etc. One thing that is worth noting is that some countries or entities do not have the ISO code, for example, "Kosovo" does not have one. When making a map, these entities may not show any information.

Usage

1
world_data(year)

Arguments

year

Year. The minimum input year is 1960.

Value

A tibble with country information around the world.

Examples

1
2
3
4
## Not run: 
world_data(2020)

## End(Not run)

PursuitOfDataScience/worlddatajoin documentation built on March 5, 2022, 12:28 a.m.