查看GADM的shapefile,它们在同一文件中存储了不同的管理级别。是否可以选择不改变线条/填充颜色的形状来决定形状?
例如,保加利亚的shapefile:https://biogeo.ucdavis.edu/data/gadm3.6/shp/gadm36_BGR_shp.zip(并在解压缩后使用gadm36_BGR_2作为file
)
## Read shapefile
shp = readOGR(file, encoding = "UTC-8", use_iconv = FALSE)
shp@data$id = rownames(shp@data)
shpPts = fortify(shp, region="id")
shpDf = plyr::join(shpPts, shp@data, by="id")
ggplot(data = shpDf) +
aes(long, lat) +
geom_polygon(aes(group = group), color = 'grey', fill = 'white') +
coord_map()
哪个基于NAME_2,我可以在不更改线条颜色或添加彩色填充的情况下绘制NAME_1边界吗?