outliers_by_polygon | R Documentation |
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.
outliers_by_polygon( pts, center_point = NA, pct = NA, tension = 0.3, buffer_size = 0.05 )
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 |
list with outlier status and sf polygon
get_alphahull_polygon
Other outlier functions:
outliers_by_box()
,
outliers_by_circle()
,
outliers_by_cluster()
,
outliers_by_density()
,
outliers_by_iforest()
,
spatial_outliers()
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.