This function will draw the alphahull for a scatterplot.

draw_alphahull(x, y, alpha = 0.5, clr = "black", fill = FALSE, out.rm = TRUE)

Arguments

x

numeric vector

y

numeric vector

alpha

transparency value of points

clr

optional colour of points and lines, default black

fill

Fill the polygon

out.rm

option to return the outlier removed alphahull

Value

A alphahull::ahull(del, alpha = alpha) "gg" object that draws the plot's alpha hull.

Examples

require(dplyr)
require(ggplot2)
#> Loading required package: ggplot2
require(alphahull)
#> Loading required package: alphahull
data("features")
nl <- features %>% filter(feature == "clusters")
draw_alphahull(nl$x, nl$y)