Filters out positions lying inside or outside an area.
The area can be defined in two ways, either by its X and Y coordinate
ranges, or by an sf-*POLYGON
object.
MULTIPOLYGON
objects are supported by the internal function
atl_within_polygon
.
atl_filter_bounds( data, x = "x", y = "y", x_range = NA, y_range = NA, sf_polygon = NULL, remove_inside = TRUE )
data | A dataframe or extension which contains X and Y coordinates. |
---|---|
x | The X coordinate column. |
y | The Y coordinate column. |
x_range | The range of X coordinates. |
y_range | The range of Y coordinates. |
sf_polygon |
|
remove_inside | Whether to remove points from within the range.
Setting |
A data frame of tracking locations with attractor points removed.
Pratik R. Gupte
if (FALSE) { filtered_data <- atl_filter_bounds( data = data, x = "X", y = "Y", x_range = c(x_min, x_max), y_range = c(y_min, y_max), sf_polygon = your_polygon, remove_inside = FALSE ) }