Airports per City

This plot shows you number of airports for citys with the most airports. See data prep for source information

Data prep

airports <- 
      read.csv("https://raw.githubusercontent.com/jpatokal/openflights/master/data/airports.dat", 
               header = FALSE)
colnames(airports) <- c("ID", "name", "city", "country", "IATA_FAA", "ICAO", "lat", "lon", "altitude", "timezone", "DST")
airports<-airports[,c(2:9,12)]
setDT(airports)
airports<-airports[,.N,city][order(N, decreasing=T)][2:11]
airports<-droplevels(airports)
names(airports)<-c("City", "Airports")

Airports per city

plot_ly(x=~City, y=~Airports, data = airports)