Reputation: 23898
I want to combine the SpatialPolygonsDataFrame
of two neighbour countries like Pakistan and India. My MWE is below:
library(raster)
Pakistan.adm1.spdf <-
getData(
"GADM"
, country = "Pakistan"
, level = 1
)
India.adm1.spdf <-
getData(
"GADM"
, country = "India"
, level = 1
)
How can I combine these two shapefiles?
Upvotes: 2
Views: 1870
Reputation:
From the answer to this question, use rbind
and the argument makeUniqueIDs
.
adm1.spdf <- rbind(Pakistan.adm1.spdf, India.adm1.spdf, makeUniqueIDs = TRUE)
plot(adm1.spdf)
Upvotes: 4