# calcConvexHull: Calculate the Convex Hull for a Set of Points In PBSmapping: Mapping Fisheries Data and Spatial Analysis Tools

## Description

Calculate the convex hull for a set of points.

## Usage

 `1` ```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`

`addPoints`, `addPolys`, `calcArea`, `calcCentroid`, `calcMidRange`, `calcSummary`, `locateEvents`, `plotMap`, `plotPoints`, `plotPolys`.

## Examples

 ```1 2 3 4 5 6 7 8``` ```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) }) ```

### Example output

```sh: 1: cannot create /dev/null: Permission denied

-----------------------------------------------------------

PBS Mapping comes with ABSOLUTELY NO WARRANTY;
for details see the file COPYING.
This is free software, and you are welcome to redistribute
it under certain conditions, as outlined in the above file.

A complete user guide 'PBSmapping-UG.pdf' is located at
/usr/lib/R/site-library/PBSmapping/doc/PBSmapping-UG.pdf

Packaged on 2017-06-28
Pacific Biological Station, Nanaimo

All available PBS packages can be found at
https://github.com/pbs-software

To see demos, type '.PBSfigs()'.
-----------------------------------------------------------
```

PBSmapping documentation built on Jan. 15, 2021, 3:41 p.m.