dict_ims | R Documentation |
Intended for use as a custom dictionary with the countrycode package, where the existing UN region and area codes do not match those used by UN DESA in the WPP, see https://github.com/vincentarelbundock/countrycode/issues/253
dict_ims
Data frame with 243 rows and 18 columns. One of first three columns intended as input for origin
in countrycode
.
Country name
ISO numeric code
ISO 3 letter code
Remaining columns intended as input for destination
in countrycode
.
Short country name
Country in UN DESA International Migration Stock data. Some codes added for older political geographies to match World Bank data and older country units in IMS
Geographic region of country (6)
Geographic sub region of country (22). Filled using region
if none given in original data
SDG region of country (8)
Sub SDG region of country (9). Filled using region_sdg
if none given in original data
World Bank region
UN development group of country (3)
World Bank income group of country (3)
Detailled World Bank income group of country (4)
Indicator variable for Land-Locked Developing Countries (32)
Indicator variable for Small Island Developing States (58)
Region grouping used for global chord diagram plots by Abel and Sander (2014)
Region grouping used for global chord diagram plots by Sander, Abel and Bauer (2014)
Region grouping used for global chord diagram plots by Abel (2018)
Region grouping used for global chord diagram plots by Abel and Cohen (2022)
The aggregates_correspondence_table_2020_1.xlsx file of United Nations Department of Economic and Social Affairs, Population Division (2020). International Migrant Stock 2020.
dict_ims
## Not run:
library(tidyverse)
library(countrycode)
# download Abel and Cohen (2019) estimates
f <- read_csv("https://ndownloader.figshare.com/files/38016762", show_col_types = FALSE)
f
# use dictionary to get region to region flows
d <- f %>%
mutate(
orig = countrycode(
sourcevar = orig, custom_dict = dict_ims,
origin = "iso3c", destination = "region"),
dest = countrycode(
sourcevar = dest, custom_dict = dict_ims,
origin = "iso3c", destination = "region")
) %>%
group_by(year0, orig, dest) %>%
summarise_all(sum)
d
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.