# NOT RUN {
require(sp)
data(meuse)
coordinates(meuse) = ~x+y
poly <- SpatialPolygonsDataFrame(SpatialPolygons(list(Polygons(list(
Polygon(cbind(c(180042, 180545, 180553, 180314, 179955,
179142, 179437, 179524, 179979, 180042), c(332373, 332026,
331426, 330889, 330683, 331133, 331623, 332152, 332357,
332373)))),'1'))), data.frame(row.names=c('1'), PIDS=1))
meuse.erase <- erase.point(meuse, poly)
par(mfrow=c(1,2))
plot(poly,)
points(meuse, pch=20)
plot(poly)
points(meuse.erase, pch=20)
# }
Run the code above in your browser using DataLab