country_codes: Country codes

Description Usage Format Examples

Description

Data frame of Gapminder country names and ISO 3166-1 country codes:

iso_alpha

The 3-letter ISO 3166-1 alpha-3 code.

iso_num

The 3-digit ISO 3166-1 numeric-3 code.

Also includes the countries covered by the supplemental data frame gapminder_unfiltered.

Usage

1

Format

An object of class tbl_df (inherits from tbl, data.frame) with 187 rows and 3 columns.

Examples

1
2
3
4
5
6
if (require("dplyr")) {
gapminder %>%
  filter(year == 2007, country %in% c("Kenya", "Peru", "Syria")) %>%
  select(country, continent) %>% 
  left_join(country_codes)
}

Example output

Loading required package: dplyr

Attaching package: 'dplyr'

The following objects are masked from 'package:stats':

    filter, lag

The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union

Joining, by = "country"
# A tibble: 3 x 4
  country continent iso_alpha iso_num
  <chr>   <fct>     <chr>       <int>
1 Kenya   Africa    KEN           404
2 Peru    Americas  PER           604
3 Syria   Asia      SYR           760
Warning message:
Column `country` joining factor and character vector, coercing into character vector 

gapminder documentation built on May 1, 2019, 7:06 p.m.