View source: R/data-processing.R
icews_to_gwcode | R Documentation |
Translate country names to Gleditsch & Ward country codes.
icews_to_gwcode(country, date)
country |
The character country name in ICEWS |
date |
Event date; some countries like Yugoslavia/Serbia and Montenegro/Serbia change over time. |
# Territories are correctly associated with metropole
df <- dplyr::tibble(
country = c("United States", "Puerto Rico", "Guam"),
event_date = rep(as.Date("2018-01-01")),
stringsAsFactors = FALSE)
df$gwcode <- icews_to_gwcode(df$country, df$event_date)
df
# Time-varying translation
df <- dplyr::tibble(
country = c("Serbia", "Serbia"),
event_date = as.Date(c("2006-06-04", "2006-06-05")),
stringsAsFactors = FALSE)
df$gwcode <- icews_to_gwcode(df$country, df$event_date)
df
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.