我已绘制了砂拉越州(马来西亚)的地图以及地区级别的边界,如图所示。
但是我的问题是,如何为特定区域(两个或多个)着色?有人可以帮我吗,砂拉越的任何地区都可以作为例子。代码如下:
#sarawak map with divisions
library(raster)
#country Malaysia with all boundaries at the district level
Malaysia <- getData('GADM', country='MYS', level=2)
#listing all districts in every states in Malaysia e.g. there are 32 districts for Sarawak state
Malaysia$NAME_1
#plotting Sarawak with all districts and their boundaries
Sarawak <- Malaysia[98:128,]
plot(Sarawak)