Subset a group of points by spatial extent

subsetByExtent(coords, cropExt = ext(c(-123, -118, 49, 52)), crs = "EPSG:4326")

Arguments

coords

data.table of point coordinates with columns "x" (longitude) and "y" (latitude) (and any additional columns), a SpatVector or object cohersible to SpatVector.

cropExt

SpatExtent or SpatVector (whose extent will be used) to subset the data to. Defaults to the SpatExtent of an area in Southern BC.

crs

passed to terra::vect() to coerce coords to a SpatVector if it is not one already.

Value

a subset coords object.