findHull: Get corners of convex hull of a set of points

Description Usage Arguments Value Author(s) Examples

View source: R/findHull.R

Description

This function gets corners coordinates of the convex hull of a set of points.

Usage

1

Arguments

data

data.frame a data frame with at least two columns named x and y.

Value

This function returns a susbet of the initial data frame where each row is a corner of the convex hull.

Author(s)

Nicolas CASAJUS, nicolas.casajus@fondationbiodiversite.com

Nicolas LOISEAU, nicolas.loiseau1@gmail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x   <- rnorm(100)
y   <- rnorm(100)
mat <- data.frame(x, y)

dat <- findHull(mat)

dat <- rbind(dat, dat[1, ])

plot(mat, pch = 19)
polygon(dat[ , 1], dat[ , 2], border = "red")

FRBCesab/ecorar documentation built on June 2, 2021, 8:18 p.m.