資料來源:政府資料開放平台 data.gov.tw

資料名稱:郵局 ATM 資料

資料格式:.csv

資料欄位:2016 筆 具有 16 個變數的資料集


(續前篇)

## Assuming "long" and "lat" are longitude and latitude, respectively

get_map source (來源) 改用 Stamen Maps,利用 ggmap 指令 繪製點圖以標示致理科大附近的郵局 ATM

map <- get_map(location = c(lon = 121.468221, lat = 25.023040),
               zoom = 12, language = "zh-TW",source = "stamen")
## Error: Google now requires an API key.
##        See ?register_google for details.
ggmap(map) + geom_point(aes(x = 經度x, y = 緯度x), data = xx) 
## Error: ggmap plots objects of class ggmap, see ?get_map

利用 ggmap 的 qmplot 指令將圖形做不同變化與處理 可參考以下以下文章:ggmap: Spatial Visualization with ggplot2ggmap:使用ggplot2進行空間可視化繪圖(上篇))

qmplot(經度x, 緯度x, data=xx, zoom = 12, maptype = "toner-lite", geom = "density2d", color = I("blue"))
## Source : http://tile.stamen.com/terrain/12/3428/1752.png
## Source : http://tile.stamen.com/terrain/12/3429/1752.png
## Source : http://tile.stamen.com/terrain/12/3430/1752.png
## Source : http://tile.stamen.com/terrain/12/3431/1752.png
## Source : http://tile.stamen.com/terrain/12/3428/1753.png
## Source : http://tile.stamen.com/terrain/12/3429/1753.png
## Source : http://tile.stamen.com/terrain/12/3430/1753.png
## Source : http://tile.stamen.com/terrain/12/3431/1753.png
## Source : http://tile.stamen.com/terrain/12/3428/1754.png
## Source : http://tile.stamen.com/terrain/12/3429/1754.png
## Source : http://tile.stamen.com/terrain/12/3430/1754.png
## Source : http://tile.stamen.com/terrain/12/3431/1754.png
## Source : http://tile.stamen.com/terrain/12/3428/1755.png
## Source : http://tile.stamen.com/terrain/12/3429/1755.png
## Source : http://tile.stamen.com/terrain/12/3430/1755.png
## Source : http://tile.stamen.com/terrain/12/3431/1755.png

qmplot(經度x, 緯度x, data=xx, size = I(3.5), alpha = I(.6), legend = "topleft")
## Using zoom = 12...

qmplot(經度x, 緯度x, data=xx, zoom = 12, maptype = "watercolor", geom = c("point","density2d"), color = "blue" )

qmplot(經度x, 緯度x, data=xx, zoom = 13, maptype = "watercolor", geom = "density2d", color = I("blue"))
## Source : http://tile.stamen.com/terrain/13/6857/3505.png
## Source : http://tile.stamen.com/terrain/13/6858/3505.png
## Source : http://tile.stamen.com/terrain/13/6859/3505.png
## Source : http://tile.stamen.com/terrain/13/6860/3505.png
## Source : http://tile.stamen.com/terrain/13/6861/3505.png
## Source : http://tile.stamen.com/terrain/13/6862/3505.png
## Source : http://tile.stamen.com/terrain/13/6857/3506.png
## Source : http://tile.stamen.com/terrain/13/6858/3506.png
## Source : http://tile.stamen.com/terrain/13/6859/3506.png
## Source : http://tile.stamen.com/terrain/13/6860/3506.png
## Source : http://tile.stamen.com/terrain/13/6861/3506.png
## Source : http://tile.stamen.com/terrain/13/6862/3506.png
## Source : http://tile.stamen.com/terrain/13/6857/3507.png
## Source : http://tile.stamen.com/terrain/13/6858/3507.png
## Source : http://tile.stamen.com/terrain/13/6859/3507.png
## Source : http://tile.stamen.com/terrain/13/6860/3507.png
## Source : http://tile.stamen.com/terrain/13/6861/3507.png
## Source : http://tile.stamen.com/terrain/13/6862/3507.png
## Source : http://tile.stamen.com/terrain/13/6857/3508.png
## Source : http://tile.stamen.com/terrain/13/6858/3508.png
## Source : http://tile.stamen.com/terrain/13/6859/3508.png
## Source : http://tile.stamen.com/terrain/13/6860/3508.png
## Source : http://tile.stamen.com/terrain/13/6861/3508.png
## Source : http://tile.stamen.com/terrain/13/6862/3508.png
## Source : http://tile.stamen.com/terrain/13/6857/3509.png
## Source : http://tile.stamen.com/terrain/13/6858/3509.png
## Source : http://tile.stamen.com/terrain/13/6859/3509.png
## Source : http://tile.stamen.com/terrain/13/6860/3509.png
## Source : http://tile.stamen.com/terrain/13/6861/3509.png
## Source : http://tile.stamen.com/terrain/13/6862/3509.png
## Source : http://tile.stamen.com/terrain/13/6857/3510.png
## Source : http://tile.stamen.com/terrain/13/6858/3510.png
## Source : http://tile.stamen.com/terrain/13/6859/3510.png
## Source : http://tile.stamen.com/terrain/13/6860/3510.png
## Source : http://tile.stamen.com/terrain/13/6861/3510.png
## Source : http://tile.stamen.com/terrain/13/6862/3510.png

qmplot(經度x, 緯度x, data=xx, zoom = 12, maptype = "toner-2011", geom = "density2d", color = I("blue"))

qmplot(經度x, 緯度x, data=xx, zoom = 12, maptype = "watercolor", geom = c("point","density2d"), color = I("blue"),extent = "device",legend = "right", padding = 0.02, force = TRUE,margins = TRUE)
## Source : http://tile.stamen.com/terrain/12/3428/1752.png
## Source : http://tile.stamen.com/terrain/12/3429/1752.png
## Source : http://tile.stamen.com/terrain/12/3430/1752.png
## Source : http://tile.stamen.com/terrain/12/3431/1752.png
## Source : http://tile.stamen.com/terrain/12/3428/1753.png
## Source : http://tile.stamen.com/terrain/12/3429/1753.png
## Source : http://tile.stamen.com/terrain/12/3430/1753.png
## Source : http://tile.stamen.com/terrain/12/3431/1753.png
## Source : http://tile.stamen.com/terrain/12/3428/1754.png
## Source : http://tile.stamen.com/terrain/12/3429/1754.png
## Source : http://tile.stamen.com/terrain/12/3430/1754.png
## Source : http://tile.stamen.com/terrain/12/3431/1754.png
## Source : http://tile.stamen.com/terrain/12/3428/1755.png
## Source : http://tile.stamen.com/terrain/12/3429/1755.png
## Source : http://tile.stamen.com/terrain/12/3430/1755.png
## Source : http://tile.stamen.com/terrain/12/3431/1755.png


不斷地透過練習,檢視資料,是熟悉資料與掌握關鍵的唯一途徑…