countrycode: Convert Country Names and Country Codes

国名と国名コードのコンバーター

> library(countrycode)
> data("countrycode_data")

バージョン: 0.18


関数名 概略
countrycode Convert Country Codes
countrycode-package Convert Country Codes or Country Names
countrycode_data Country Code Translation Data Frame

countrycode

Arguments

  • sourcevar
  • origin
  • destination
  • warn
> countrycode_data$cowc %>% {
+   print(head(.))
+   countrycode(., "cowc", "iso3c") %>% head()
+ }
[1] "AFG" NA    "ALB" "ALG" NA    "AND"
[1] "AFG" NA    "ALB" "DZA" NA    "AND"

countrycode_data

> data("countrycode_data")
> dplyr::glimpse(countrycode_data)
Observations: 273
Variables: 15
$ country.name (chr) "Afghanistan", "Aland Islands", "Albania", "Alger...
$ cowc         (chr) "AFG", NA, "ALB", "ALG", NA, "AND", "ANG", NA, NA...
$ cown         (int) 700, NA, 339, 615, NA, 232, 540, NA, NA, 58, 160,...
$ fao          (int) 2, NA, 3, 4, NA, 6, 7, NA, NA, 8, 9, 1, NA, 10, 1...
$ fips104      (chr) "AF", NA, "AL", "AG", "AQ", "AN", "AO", "AV", "AY...
$ imf          (int) 512, NA, 914, 612, 859, NA, 614, 312, NA, 311, 21...
$ ioc          (chr) "AFG", NA, "ALB", "ALG", "ASA", "AND", "ANG", "AI...
$ iso2c        (chr) "AF", "AX", "AL", "DZ", "AS", "AD", "AO", "AI", "...
$ iso3c        (chr) "AFG", "ALA", "ALB", "DZA", "ASM", "AND", "AGO", ...
$ iso3n        (int) 4, 248, 8, 12, 16, 20, 24, 660, 10, 28, 32, 51, 5...
$ un           (int) 4, 248, 8, 12, 16, 20, 24, 660, NA, 28, 32, 51, 5...
$ wb           (chr) "AFG", "ALA", "ALB", "DZA", "ASM", "ADO", "AGO", ...
$ regex        (chr) "afghan", "\\b(a|å)land", "albania", "algeria", "...
$ continent    (chr) "Asia", "Europe", "Europe", "Africa", "Oceania", ...
$ region       (chr) "Southern Asia", "Northern Europe", "Southern Eur...