r-如何给地图/陆地区域着色,给定2类点?

问题描述 投票:0回答:1

[我将创建类似于R中的this的巴布亚/南澳大利亚语语言分布图。

[为此,我收集了transnewguinea.orgAustronesian Basic Vocabulary Database中列出的语言的地理参考,以及它们的分类方式,例如为Austronesian还是Papuan。可以轻松地在地图上将这些数据绘制为有色点:

data <- data.frame(lat = c(-16.6098, -4.6236, -7.56399200553307, -21.0735, -2.13, -2.76, 
                           -2.55, -3.79, -8.71919, -3.63, -16.4952, -3.4004, -8.42, 9.76831962330826, 
                           -8.38543101556771, -8.7257, -0.14316066226984, -3.8, -5.9164, 
                           5, -5, -8.57966283377484, -7.74, -21.6524, -6.47, -16.5499, -4.67, 
                           -4.48607103437042, -2.2555, -3.57785, 5.3, -6.26, -10.0734060631886, 
                           -8, -8.62273552315168, -9.23, -4.8008, -16.4687, -3.7, -10.15, 
                           -15.9914, -7.4778, -6.19, -4.45, -5.52, -0.95, -9.616667, 7.33, 
                           -8.58405, -15.8559, -15.9914, -2.69797689175062, -9.40571004160002, 
                           -10.0734060631886, -4.67, -7.29, -6.67, -5.52851052569279, -15.633, 
                           -6.3153, -8.09, -8.66791800236312, -3.67, -8.67606354930773, 
                           -8.37, -16.0903, -4.46, -3.82, -6.66733557666654, -16.0095, -16.4582, 
                           -8.17, -5.83, -14.9738, -15.9813, -1.78, -8.28444635517256, -1.917, 
                           -7.75, -16.4339, -10.22, 5.333333, -16.0903, -19.5303, -16.8979, 
                           -2.37, 2.30925, 1.05, -4.3, -4.05, -1.5297, -15.3498, -4.696879026, 
                           -9.06, -2.1143, -5.89078468421825, -8.932, -3.33, -4.5, -1.09129174695414),
                   lon = c(168.171, 121.824, 127.41943359375, 164.869, 132.45, 132.06, 
                           136.69, 140.2, 117.47199, 140.77, 167.78, 154.731, 160.58, 119.569541928441, 
                           162.740478515625, 151.072, 128.487258649535, 142.3, 146.859, 
                           116, 143.89, 125.619226658682, 139.27, 165.578, 143.5, 167.509, 
                           146, 154.215087890625, 121.035, 128.31046, 163, 145.73, 120.702381123445, 
                           147.23, 149.827019548963, 148.45, 105.33909, 167.4961, 142.02, 
                           148.45, 167.288, 178.69192, 147.58, 151.7, 144.12, 135.88, 161.45, 
                           149.33, 157.29578, 168.189, 167.288, 104.915771372616, 119.6630859375, 
                           120.702381123445, 143.85, 142.64, 139.25, 148.677978515625, 166.9525, 
                           130.01495, 127.2, 116.279296875, 142.68, 121.835632324219, 138.07, 
                           167.239, 143.06, 141.34, 147.513427734375, 167.3464, 167.6396, 
                           128, 132.92, 168.12, 167.208, 132.31, 129.917695058198, 146.887, 
                           156.666667, 167.566, 166.22, 132.25, 167.239, 170.215, 168.569, 
                           139.75, 128.15277, 154.75, 143.32, 141.42, 145.074, 166.891, 
                           121.607666015625, 159.12, 146.627, 155.211915129668, 146.749, 
                           134.88, 140.44, 172.110425708816),
                   lang = structure(c(1L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 1L, 1L, 
                                      1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 
                                      1L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 
                                      1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 
                                      1L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 
                                      1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 
                                      2L, 1L, 1L, 1L, 1L, 2L, 1L), .Label = c("Austronesian", "Papuan"
                                      ), class = "factor")
)

require(maps)
map("world2", xlim=c(120,200), ylim=c(-25,10), fill=T, col="gray")
points(data$lon, data$lat, col=data$lang, pch=16)

在上面的代码中,我仅提供了100种语言记录的示例。但是,原始数据库要大得多(请参见附件中所考虑区域所有语言样本的图):

enter image description here

但是,我不知道如何根据空间样本分布来估计语言组的近似区域,以及如何将这些估计的语言区域作为有色区域绘制在地图上。

感谢您的帮助!在此先多谢!

r maps spatial-interpolation
1个回答
0
投票

@ jazzurro的建议很好。但是,经过多次试验,我没有成功。但是,我找到了其他解决方案的第一步。这非常简单,基本上使用Voronoi多边形为地图区域着色:

© www.soinside.com 2019 - 2024. All rights reserved.