voronoi: Voronoi segmentation

Description Usage Arguments Details Value Author(s) See Also

View source: R/voronoi.R


Calculates the Voronoi (nearest-neighbor) segmentation of a two-dimensional rectangular region based on a set of points.


voronoi(pts, bbox = NULL)



a two column array of points around which to calculate Voronoi cells


the rectangular bounding box the Voronoi cells must fill, represented by a length 4 vector of the form c(xmin,xmax,ymin,ymax). If NULL, a bounding box will be constructed containing all points with padding on each side


Though this function is not strictly necessary to the use of other functions in this package, we found the construction of a Voronoi segmentation to be a rather tedious task, and felt that making the function available to those who want a simple segmentation function was a reasonable choice.


A data frame intended for use in the ggplot2 function geom_polygon. The data frame describes one polygon for each given input point, with the 'x' and 'y' columns specifying the x- and y-coordinates of the vertices of the polygon, and the column 'poly' specifying the index of the point (in the input array pts) around which the polygon sits.


Nathaniel R. Twarog

See Also


braidReports documentation built on May 1, 2019, 9:18 p.m.