![](/img/trans.png)
[英]Replicating leafletjs interactive choropleth map example using leaflet package in R
[英]R - plotMapDomFlows (“flows” package) on Leaflet map
R中有一個名為“flow”的軟件包(詳見此處) ,它允許您繪制流交互圖(通過函數plotMapDomFlows()從平方流的矩陣中繪制 。這是一個示例,包含數據,輸出的樣子:
# Import data
data(nav)
myflows <- prepflows(mat = nav, i = "i", j = "j", fij = "fij")
# Remove the matrix diagonal
diag(myflows) <- 0
# Select flows that represent at least 20% of the sum of outgoing flows for
# each urban area.
flowSel1 <- firstflows(mat = myflows/rowSums(myflows)*100, method = "xfirst",
k = 20)
# Select the dominant flows (incoming flows criterion)
flowSel2 <- domflows(mat = myflows, w = colSums(myflows), k = 1)
# Combine selections
flowSel <- myflows * flowSel1 * flowSel2
# Node weights
inflows <- data.frame(id = colnames(myflows), w = colSums(myflows))
# Plot dominant flows map
opar <- par(mar = c(0,0,2,0))
sp::plot(GE, col = "#cceae7", border = NA)
plotMapDomFlows(mat = flowSel, spdf = UA, spdfid = "ID", w = inflows, wid = "id",
wvar = "w", wcex = 0.05, add = TRUE)
我想在使用R的傳單地圖上有這些線和多邊形。
有任何想法嗎?
目前這是不可能的。 我們計划盡快更新套餐。 此功能(行和點導出)可能是更新引入的新功能之一。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.