Learn R Programming

tmap (version 1.4-1)

crop_shape: Crop shape object

Description

Crop a shape object (from class Spatial-class or Raster).

Usage

crop_shape(x, y, ...)

Arguments

x
shape object, i.e. an object from class Spatial-class or Raster
y
bounding box (2 by 2 matrix), an extent, or a shape object from which the bounding box is extracted.
...
arguments passed on to crop

Details

This function is a wrapper around crop from the raster package. It does two things in addition: SpatialGrid objects are allowed, and if y is a shape object with a different projection, it is temporarily reprojected in order to obtain a bounding box by which x is cropped.

See Also

bb

Examples

Run this code
data(Europe, land)

land_europe <- crop_shape(land, Europe)

qtm(land_europe, raster="trees", style="natural")

Run the code above in your browser using DataLab