Merge polygons and plot using spplot()
问题 I would like to merge some regions in gadm data and then plot the map. So far I have the following: #install.packages("sp",dependencies=TRUE) #install.packages("RColorBrewer",dependencies=TRUE) #install.packages("maptools",dependencies=TRUE) library(sp) library(maptools) #library(RColorBrewer) # get spatial data con <- url("http://gadm.org/data/rda/CZE_adm2.RData") print(load(con)) close(con) IDs <- gadm$ID_2 IDs[IDs %in% c(11500:11521)] <- "11500" gadm_new <- unionSpatialPolygons(gadm, IDs)