Detects which positions intersect a sfc_*POLYGON
. Tested
only for single polygon objects.
Arguments
- data
A dataframe or similar containg at least X and Y coordinates.
- x
The name of the X coordinate, assumed by default to be "x".
- y
The Y coordinate as above, default "y".
- polygon
An
sfc_*POLYGON
object which must have a defined CRS. The polygon CRS is assumed to be appropriate for the positions as well, and is assigned to the coordinates when determining the intersection.