Crop shape object
crop_shape(x, y, polygon = FALSE, ...)
x |
shape object, i.e. an object from class |
y |
bounding box, an |
polygon |
should |
... |
not used anymore |
This function is similar to crop from the raster package. The main difference is that crop_shape also allows to crop using a polygon instead of a rectangle.
cropped shape, in the same class as x
if (require(tmap) && packageVersion("tmap") >= "2.0") {
data(World, NLD_muni, land, metro)
#land_NLD <- crop_shape(land, NLD_muni)
#qtm(land_NLD, raster="trees", style="natural")
metro_Europe <- crop_shape(metro, World[World$continent == "Europe", ], polygon = TRUE)
qtm(World) +
tm_shape(metro_Europe) +
tm_bubbles("pop2010", col="red", title.size="European cities") +
tm_legend(frame=TRUE)
}Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.