ahull2poly: Convert alpha hull to SpatialPolygon

View source: R/hull2poly.R

ahull2polyR Documentation

Convert alpha hull to SpatialPolygon

Description

Convert alpha hull to SpatialPolygon

Usage

ahull2poly(hull)

Arguments

hull

The alpha hull object

Value

The SpatialPolygon object created by that alpha hull

Examples

data(iris)
iris_sepals <- iris[,1:2]
iris_sepals <- iris_sepals[!duplicated(paste(iris_sepals$Sepal.Length, iris_sepals$Sepal.Width)), ]
alphahull_1 <- alphahull::ahull(iris_sepals, alpha = 1)
hullpoly_1 <- ahull2poly(alphahull_1)
plot(iris_sepals, pch = 19, col = "darkseagreen")
plot(alphahull_1, lwd = 5, col = "gray", add = TRUE)
sp:::plot.SpatialPolygons(hullpoly_1, border = "magenta", add = TRUE)

babichmorrowc/hull2spatial documentation built on Oct. 22, 2023, 12:28 a.m.