我想在 R 中创建一张欧洲地图来绘制我的一些数据。我修改了下面的代码(取自:http ://www.r-bloggers.com/provincial-map-using-gadm/ )给我一张欧洲地图。一切都很好,只是波罗的海沿岸的俄罗斯碎片消失了。
如何提取俄罗斯多边形的那一部分以维护真实的欧洲地图?
library(sp)
library(raster)
## Download Map of the World ##
WorldMap <- getData('countries')
## Subset world map to European countries ##
EuropeMap <- (WorldMap[WorldMap$CONTINENT=="Europe" & WorldMap$COUNTRY != "Russia",])
## Plot map ##
plot(EuropeMap, bg = "dodgerblue", axes = T)
plot(EuropeMap, lwd = 10, border = "skyblue", add = T)
plot(EuropeMap, col ="green4", add = T)
grid()
box()
invisible(text(getSpPPolygonsLabptSlots(EuropeMap), labels = as.character(EuropeMap$COUNTRY), cex = 0.5, col = "white", font = 2))
mtext(side = 3, line = 1, "Map of Europe", cex = 2)
mtext(side = 1, "Longtiude", line = 2.5, cex = 1.1)
mtext(side = 2, "Latitude", line = 2.5, cex = 1.1)
text(40,30, "Projection: Geographic\nCoordinate System: WGS 1984\nData Source: GADM.org\nCreated by: Keith Larson", adj = c(0,0), cex = 0.7, col = "grey20")
text(-35, 75, "Calopteryx splendens", col="white", font=3, cex=1.5)