我有一个空间数据集(长/纬度)。我想确定数据集中的低密度区域。我可以计算最近的高度距离,但是如何使用它来识别玩具数据中的左下角密度较低?理想情况下,我希望使用完整的数据集将数据输入R中,并能够自动划定低/高使用率区域。似乎是一个基本问题,但我找不到正确的方法...
玩具数据:
library(spdep)
thing <- structure(list(X = c(35.619999, 36.5, 36.709999, 33.360001, 38.799999,
39.82, 40.009998, 43.75, 39.610001, 47.610001, 48.580002, 49.610001,
50.110001, 51.240002, 50.889999, 48.439999, 46.73, 43.439999,
43.369999, 41.130001, 35), Y = c(42.380001, 40.52, 38.709999,
38.41, 44.07, 41.18, 38, 39.279999, 34.91, 36.419998, 34.459999,
32.650002, 29.91, 27.799999, 25.24, 27.93, 31.91, 35.919998,
33.459999, 33.139999, 28)), row.names = c("1001", "1002", "1003",
"1004", "1005", "1006", "1007", "1008", "1009", "1010", "1011",
"1012", "1013", "1014", "1015", "1016", "1017", "1018", "1019",
"1020", "21"), class = "data.frame")
wd1 <- dnearneigh(as.matrix(thing), 0, 1000, longlat = TRUE)
coordinates(thing) <- ~X + Y
xy <- coordinates(thing)
plot(wd1, xy, add=TRUE, pch=20)