voronoi: Voronoi polygons

Description Usage Arguments Value Author(s) Examples

Description

Create Voronoi polygons for a set of points. (These are also known Thiessen polygons, and Nearest Neighbor polygons; and the technique used is referred to as Delauny triangulation.)

Usage

1
voronoi(xy, ext, eps=1e-09, ...)

Arguments

xy

SpatialPoints* or two column matrix with x and y coordinates

ext

Extent. Can be used to set the corners of the rectangular window enclosing the triangulation. The default is the data range plus 10 percent. See deldir

eps

Numerical tolerance used in triangulation. See deldir

...

Additional arguments (none)

Value

SpatialPolygonsDataFrame

Author(s)

This is based on the link[deldir]{deldir} function by Rolf Turner and code by Carson Farmer: http://www.carsonfarmer.com/?p=455

Examples

1
2
3
4
5
6
# points
p <- matrix(c(17, 42, 85, 70, 19, 53, 26, 84, 84, 46, 48, 85, 4, 95, 48, 54, 66, 74, 50, 48, 
      28, 73, 38, 56, 43, 29, 63, 22, 46, 45, 7, 60, 46, 34, 14, 51, 70, 31, 39, 26), ncol=2)
	  
v <- voronoi(p)
v

Example output

Loading required package: raster
Loading required package: sp
Loading required namespace: deldir
class       : SpatialPolygonsDataFrame 
features    : 20 
extent      : -5.1, 104.1, 0.4, 79.6  (xmin, xmax, ymin, ymax)
coord. ref. : NA 
variables   : 1
names       : id 
min values  :  1 
max values  : 20 

dismo documentation built on May 2, 2019, 6:07 p.m.