## Load districts of Germany
load(system.file("shapes", "districtsD.RData", package="surveillance"))
## Union these districts
plot(unionSpatialPolygons(districtsD, method="polyclip"), border=0, col=1)
plot(districtsD, add=TRUE, border="lightgrey")
if (requireNamespace("rgeos"))
plot(unionSpatialPolygons(districtsD, method="rgeos"),
add=TRUE, border=2, lwd=2)
Run the code above in your browser using DataLab