p <- as_coord2d(x = rnorm(25), y = rnorm(25))
print(convex_hull2d(p))
# Equivalent to following caculation using `grDevices::chull()`
all.equal(convex_hull2d(p),
p[rev(grDevices::chull(as.list(p)))])
Run the code above in your browser using DataLab