powered by
This function will draw the Convex Hull for a scatterplot.
draw_convexhull(x, y, alpha = 0.5, clr = "black", fill = FALSE, out.rm = TRUE)
A "gg" object that draws the plot's convex hull.
numeric vector
transparency value of points
optional colour of points and lines, default black
Fill the polygon
option to return the outlier removed convex hull
require(dplyr) require(ggplot2) data("features") nl <- features %>% filter(feature == "clusters") draw_convexhull(nl$x, nl$y, fill=TRUE, out.rm=FALSE)
Run the code above in your browser using DataLab