alphahull | R Documentation |
Calculate a window containing all points of a point pattern. The window is not convex but as close as possible to the points.
alphahull(X, alpha = NULL)
X |
a planar point pattern (spatstat.geom::ppp.object). |
alpha |
a smoothing parameter to delimit concave polygons. |
The typical use of this function is to define a narrow window around a point pattern that has been created with a default, rectangle window.
The window is built by the alphahull::ashape()
function and then transformed
into a spatstat.geom::owin.object.
The alpha
parameter determines the smallest size of zones excluded from the window.
If it is not specified, a first attempt is 1/256 of the diameter of the existing window of X
.
If the shape cannot be calculated, alpha
is doubled and a new attempt is made.
A window, i.e. a spatstat.geom::owin.object.
spatstat.geom::convexhull
# Simulate a point pattern
if (require(spatstat.random)) {
X <- rpoispp(50)
plot(X)
# Calculate its border
X$window <- alphahull(X)
plot(X)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.