25/6/2020

Overview

This presentation contains a plot of the 500 most populous cities in the world according to the data from Simple Maps. The population is rescaled to millions and it is colored accordingly. The plot is made with the plotly package.

The whole code (including the markdown file) is available on my github.

Data Processing

Code used for processing the data.

cols.keep <- c("city_ascii", "lat", "lng", "country", "population")
dat <- fread("worldcities.csv", select=cols.keep)

dat$population <- dat$population/1e6

dat <- dat[order(-population)]

dat <- dat[1:500,]

dat$popup <- paste(dat$city_ascii, "<br> Country:", dat$country,
                   "<br> Population:", as.character(round(dat$population, 3)),
                   "Millions", sep=" ")

500 Most Populous Cities

Thanks