6
我想繪製一些信息,顯示全部人口,然後在地圖上顯示該人口的子集。我已經看到使用同心圓或三維倒錐體傳達這一點的數據可視化。我只是無法弄清楚如何做到這一點的ggplot
/ggmap
R ggplot2/ggmap同心圓爲點
下面是Paint
放開手腳版本,顯示的就是我希望做一個粗略的想法:
這裏有一個粗略的一塊的數據爲例:
> dput(df1)
structure(list(zip = c("00210", "00653", "00952", "02571", "04211",
"05286", "06478", "07839", "10090", "11559"), city = c("Portsmouth",
"Guanica", "Sabana Seca", "Wareham", "Auburn", "Craftsbury",
"Oxford", "Greendell", "New York", "Lawrence"), state = c("NH",
"PR", "PR", "MA", "ME", "VT", "CT", "NJ", "NY", "NY"), latitude = c(43.005895,
17.992112, 18.429218, 41.751554, 44.197009, 44.627698, 41.428163,
41.12831, 40.780751, 40.61579), longitude = c(-71.013202, -66.90097,
-66.18014, -70.71059, -70.239485, -72.434398, -73.12729, -74.678956,
-73.977182, -73.73126), timezone = c(-5L, -4L, -4L, -5L, -5L,
-5L, -5L, -5L, -5L, -5L), dst = c(TRUE, FALSE, FALSE, TRUE, TRUE,
TRUE, TRUE, TRUE, TRUE, TRUE), totalPop = c(43177, 37224, 37168,
15492, 1614, 88802, 2587, 80043, 78580, 87461), subPop = c(42705,
36926, 27556, 10827, 774, 39060, 1542, 21304, 53438, 2896)), .Names = c("zip",
"city", "state", "latitude", "longitude", "timezone", "dst",
"totalPop", "subPop"), row.names = c(1L, 50L, 200L, 900L, 1500L,
2000L, 2500L, 3000L, 3500L, 4000L), class = "data.frame")
有什麼建議嗎?
太好了。非常感謝你。 – screechOwl
此鏈接使用類似的方法在各州之間創建熱圖http://www.dataincolour.com/2011/07/maps-with-ggplot2/ – chandler