atl_filter_bounds: Filter positions by an area.

Description Usage Arguments Details Value

View source: R/fun_filter_by_bounds.R

Description

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.

Usage

1
2
3
4
5
6
7
8
9
atl_filter_bounds(
  data,
  x = "x",
  y = "y",
  x_range = NA,
  y_range = NA,
  sf_polygon = NULL,
  remove_inside = TRUE
)

Arguments

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

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.

remove_inside

Whether to remove points from within the range. Setting negate = TRUE removes positions within the bounding box specified by the X and Y ranges.

Details

This function does not modify in place, i.e., the results need to be assigned to a new data.table.

Value

A data frame of tracking locations with attractor points removed.


Orrslab/Pratik_atlastools documentation built on Dec. 31, 2020, 3:23 p.m.