occ.data: a data frame, with columns for occurrence record co-ordinates and dates with column names as follows; record longitude as "x", latitude as "y", year as "year", month as "month", and day as "day".
temporal.ext: optional; a character vector, two dates in format "YYYY-MM-DD". First date represents start of temporal extent and second date represents end of temporal extent for inclusion.
spatial.ext: the spatial extent to filter by. Object from which extent can be extracted of class SpatExtent, SpatRaster, sf polygon or numeric vector listing xmin, xmax, ymin and ymax in order.
prj: a character string, the coordinate reference system of input occ.data co-ordinates. Default is "+proj=longlat +datum=WGS84".
Returns
Returns data frame of occurrence records filtered to the spatial and temporal extent given.
Spatial extent
If spatial.ext is provided, spatiotemp_extent() checks whether species occurrence record co-ordinates are within the given spatial extent of the study (spatial.ext) and excludes any outside of this extent.
If spatial.ext object can be used as a mask by terra::mask() then the mask is used to filter records in a more targeted way. If not, then the rectangular extent of the spatial.ext object is used.
Temporal extent
If temporal.ext is provided, spatiotemp_extent() checks whether species occurrence record dates are within the given temporal extent of the study and excludes any outside of this extent.