结合两个邻国的SpatialPolygonsDataFrame

Combining SpatialPolygonsDataFrame of two neighbour countries

我想合并巴基斯坦和印度等两个邻国的SpatialPolygonsDataFrame。我的 MWE 如下:

library(raster)
Pakistan.adm1.spdf <- 
  getData(
    "GADM"
    , country = "Pakistan"
    , level = 1
  )

India.adm1.spdf <- 
  getData(
    "GADM"
    , country = "India"
    , level = 1
  )

如何合并这两个 shapefile?

the answer to this question 开始,使用 rbind 和参数 makeUniqueIDs

adm1.spdf <- rbind(Pakistan.adm1.spdf, India.adm1.spdf, makeUniqueIDs = TRUE)
plot(adm1.spdf)