# NOT RUN {
if (require(rgdal) & require(rgeos)) {
p <- shapefile(system.file("external/lux.shp", package="raster"))
b <- as(extent(6, 6.4, 49.75, 50), 'SpatialPolygons')
projection(b) <- projection(p)
e <- erase(p, b)
plot(e)
}
# }
Run the code above in your browser using DataLab