Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

calcConvexHull

Calculate the Convex Hull for a Set of Points


Description

Calculate the convex hull for a set of points.

Usage

calcConvexHull (xydata, keepExtra=FALSE)

Arguments

xydata

a data frame with columns X and Y containing spatial coordinates.

keepExtra

logical: if TRUE, retain any additional columns from the input data frame xydata.

Details

This routine uses the function chull() in the package grDevices. By default, it ignores all columns other than X and Y; however, the user can choose to retain additional columns in xydata by specifying keepExtra=TRUE.

Value

PolySet with columns PID, POS, X, Y, and additional columns in xydata if keepExtra=TRUE.

Author(s)

Nicholas M. Boers, Associate Professor – Computer Science
MacEwan University, Edmonton AB
Last modified Rd: 2013-04-10

See Also

Examples

local(envir=.PBSmapEnv,expr={
  oldpar = par(no.readonly=TRUE)
  data(surveyData,envir=.PBSmapEnv)
  #--- plot the convex hull, and then plot the points
  plotMap(calcConvexHull(surveyData),col="moccasin")
  addPoints(surveyData,col="blue",pch=17,cex=.6)
  par(oldpar)
})

PBSmapping

Mapping Fisheries Data and Spatial Analysis Tools

v2.73.0
GPL (>= 2)
Authors
Jon T. Schnute [aut], Nicholas Boers [aut], Rowan Haigh [aut, cre], Alex Couture-Beil [ctb], Denis Chabot [ctb], Chris Grandin [ctb], Angus Johnson [ctb], Paul Wessel [ctb], Franklin Antonio [ctb], Nicholas J. Lewin-Koh [ctb], Roger Bivand [ctb]
Initial release
2021-01-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.