Friday, March 15, 2019

Creating a simple world map of cities in R

Mike (from cool but useless) asked on twitter if there is any package in R with with lats/longs of lots of cities. In fact there is. Here is a simple code to create a world map of cities with population larger than 40K in R using maps::world.cities and ggplot2.

ps. These population data in the maps package refers to 2016 estimates. If you want city population data from previous years, you might remember that we have previously posted about this open dataset with 6,000 years of global urbanization.