Learn R Programming

tmap (version 0.7)

crop_shape: Crop shape objects

Description

Crop a shape object to a rectangle which is by default its bounding box.

Usage

crop_shape(shp, bbox = shp@bbox, set.bbox = TRUE)

Arguments

shp
shape object, which is one of
  1. SpatialPolygons(DataFrame)

Value

  • A cropped shape object. Its bounding box is set to bb. Data is retained in case shp has data. A vector of matched ID's is stored as a attribute matchID. This vector contains for each polygon in the returned shape object the number of its orignal polygon in shp.

item

  • bbox
  • set.bbox

code

shp