0

R中有一个名为“flows”的包(详细信息here),它允许您绘制流交互图(通过函数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 将这些线条和多边形放在传单地图上。

有任何想法吗?

4

1 回答 1

0

目前这是不可能的。我们计划很快更新软件包。此功能(线和点导出)可能是更新引入的新功能之一。

于 2019-05-23T15:52:00.730 回答