## Load districts of Germany
load(system.file("shapes", "districtsD.RData", package="surveillance"))
## indicate districts at the border
districtAtBorder <- polyAtBorder(districtsD)
## plot to check
plot(districtsD, col=districtAtBorder)
## polyclip cannot be used with the default snapping tolerance
plot(districtsD, col=polyAtBorder(districtsD, method="polyclip"))
## but increasing the tolerance gives the correct result
stopifnot(identical(districtAtBorder,
polyAtBorder(districtsD, snap=1e-6, method="polyclip")))
Run the code above in your browser using DataLab