Skip to contents

Extract spatial features inside a polygon

Usage

hotspot_clip(data, boundary, quiet = FALSE, ...)

Arguments

data

sf data frame containing spatial features.

boundary

sf data frame containing polygons.

quiet

if set to TRUE, messages reporting the values of any parameters set automatically will be suppressed. The default is FALSE.

...

Further arguments passed to st_intersection.

Value

an SF data frame containing those spatial features that are covered by the polygons.

Details

This function is a wrapper around st_intersection that performs some additional checks and reports useful information. If data has a specialised result class produced by this package, that class is preserved in the clipped result. A warning is produced if clipping reduces the dimension of any geometry, such as from a polygon to a line.