This report will make a Leaflet plot, showing the population distribution of each province for China
| name | lat | lng | Population | |
|---|---|---|---|---|
| 1 | Aomen | 21.33 | 115.07 | 55.23 |
| 2 | Lasa | 29.39 | 91.08 | 300.21 |
| 3 | Xining | 36.38 | 101.48 | 562.67 |
| 4 | Yinchuan | 38.27 | 106.16 | 630.14 |
| 5 | Hong Kong | 21.23 | 115.12 | 709.76 |
| 6 | Haikou | 20.02 | 110.20 | 867.15 |
| 7 | Tianjin | 39.02 | 117.12 | 1293.82 |
| 8 | Beijing | 39.55 | 116.24 | 1961.20 |
| 9 | Wulumuqi | 43.45 | 87.36 | 2181.33 |
| 10 | Shanghai | 31.14 | 121.29 | 2301.39 |
| 11 | Taibei | 25.03 | 121.30 | 2316.20 |
| 12 | Huhehaote | 40.48 | 111.41 | 2470.63 |
| 13 | Lanzhou | 36.04 | 103.51 | 2557.53 |
| 14 | Changchun | 43.54 | 125.19 | 2746.22 |
| 15 | Chongqing | 29.35 | 106.33 | 2884.00 |
| 16 | Guiyang | 26.35 | 106.42 | 3476.65 |
| 17 | Fuzhou | 26.05 | 119.18 | 3552.00 |
| 18 | Taiyuan | 37.54 | 112.33 | 3571.21 |
| 19 | Xi’an | 34.17 | 108.57 | 3732.74 |
| 20 | Ha’erbing | 45.44 | 126.36 | 3831.22 |
| 21 | Shengyang | 41.48 | 123.25 | 4374.63 |
| 22 | Nanchang | 28.40 | 115.55 | 4456.74 |
| 23 | Kumming | 25.04 | 102.42 | 4596.60 |
| 24 | Nanning | 22.48 | 108.19 | 4602.66 |
| 25 | Hangzhou | 30.16 | 120.10 | 5442.00 |
| 26 | Wuhan | 30.35 | 114.17 | 5723.77 |
| 27 | Hefei | 31.52 | 117.17 | 5950.10 |
| 28 | Changsha | 28.12 | 112.59 | 6568.37 |
| 29 | Shijiazhuang | 38.02 | 114.30 | 7185.42 |
| 30 | Nanjing | 32.03 | 118.46 | 7865.99 |
| 31 | Xuzhou | 34.15 | 117.11 | 7865.99 |
| 32 | Chengdu | 30.40 | 104.04 | 8041.82 |
| 33 | Zhengzhou | 34.46 | 113.40 | 9402.36 |
| 34 | Jinan | 36.40 | 117.00 | 9579.31 |
| 35 | Guangzhou | 23.08 | 113.14 | 10430.03 |
In this section, I will make a Leaflet plot. You will see a NASA-Earth-At-Night style tiles and some cilcles, centers of which represents the capital of that province and radius of which represents the poplation of that province.
Since I used assProviderTiles() to load NASA-Earth-At-Night tile instead of addTiles(), you need to wait for a short minute for the tile appearing.
library(leaflet)
library(grDevices)
colorPal <- colorRampPalette(c("snow", "lightyellow"))
pop_cities %>% leaflet() %>% addProviderTiles("NASAGIBS.ViirsEarthAtNight2012") %>%
addCircles(weight = 1, radius = pop_cities$Population*30, popup = pop_cities$name,
color = colorPal(dim(pop_cities)[1]))