outliers_by_polygon: Spatial outliers: POLYGON Method

View source: R/spaceout.R

outliers_by_polygonR Documentation

Spatial outliers: POLYGON Method

Description

Spatial outlier method that uses distance from a central point to draw a bounding polygon from which to determine outlier status. The outliers should be identical to the circle method, except the shape will account for anisotropy in the the point pattern. The polygon is built with alpha hull, so the user can specify tension and buffer size. Note that, for very low (tighter) tension values edge effects may lead to differences from the circle method.

Usage

outliers_by_polygon(
  pts,
  center_point = NA,
  pct = NA,
  tension = 0.3,
  buffer_size = 0.05
)

Arguments

pts

sf points

center_point

(optional) sf point with location to measure from

pct

(optional) percentile to use for determining distance from center point

tension

(optional) value from 0 to 1 to control how tight polygon should wrap around points

buffer_size

(optional) buffer around exterior points, in coordinate units

Value

list with outlier status and sf polygon

See Also

get_alphahull_polygon

Other outlier functions: outliers_by_box(), outliers_by_circle(), outliers_by_cluster(), outliers_by_density(), outliers_by_iforest(), spatial_outliers()

Examples

data("pdx_breweries")
pts <- pdx_breweries$geometry
x <- outliers_by_polygon(pts)
plot(pts)
plot(pts[x[[1]]==-1], col="red", add=TRUE)
plot(x[[2]], add=TRUE)

nhoteling/spaceheater documentation built on Sept. 24, 2022, 3:04 p.m.