[問題類型]:
Openstreetmap
[軟體熟悉度]:
會基本資料清理,資料分析,
[問題敘述]:
想以Openstreetmap 加入圓餅圖
圓餅圖是顯示該地的iris的Species比例
[程式範例]:
install.packages("OpenStreetMap")
install.packages("leaflet")
install.packages("magrittr")
install.packages("mapproj")
library(OpenStreetMap)
library( leaflet )
library( magrittr )
library( mapproj )
subscr<-data.frame(lat=c(55.381640),lon=c(10.433600)
m <- leaflet() %>% setView(lng=120.239, lat=22
.992, zoom
= 12)
m%>% addTiles()
m %>% addProviderTiles("Stamen.Toner")
# 畫圓圈
#addCircleMarkers(data = subscr,
lat = ~lat, lng = ~lon,
color = "blue")
# Pie Chart from data frame with Appended Sample Sizes
mytable <- table(iris$Species)
lbls <- paste(names(mytable), "\n", mytable, sep="")
pie(mytable, labels = lbls,ꀊꂠ main="Pie Chart of Species\n (with sample sizes)")
[環境敘述]:
R 6.3.3
[關鍵字]:
Openstreetmap