if (FALSE) {
library(rnaturalearth)
library(WDI)
library(tigris)
dat <- WDI(country = "all", indicator = "SP.DYN.LE00.IN", start = 2012, end = 2012)
dat$SP.DYN.LE00.IN <- round(dat$SP.DYN.LE00.IN, 1)
countries <- ne_countries()
countries2 <- geo_join(countries, dat, 'iso_a2', 'iso2c')
nrow(countries2)
## [1] 177
countries3 <- geo_join(countries, dat, 'iso_a2', 'iso2c', how = 'inner')
nrow(countries3)
## [1] 169
}
Run the code above in your browser using DataLab