Learn R Programming

Rvision (version 0.6.0)

convexHull: Compute the Convex Hull of a Set of Points

Description

convexHull computes the subset of points which lie on the convex hull of the set of points specified.

Usage

convexHull(x, y, clockwise = TRUE)

Arguments

x

A vector of x coordinates.

y

A vector of y coordinates of the same lenght as x.

clockwise

If TRUE (the default), the output convex hull is oriented clockwise. Otherwise, it is oriented counter-clockwise.

Value

A vector indicating the index of the points on the convex hull.

Examples

Run this code
# NOT RUN {
convexHull(rnorm(100), rnorm(100))

# }

Run the code above in your browser using DataLab