voronoi: Random tessellation using Voronoi tiles

voronoiR Documentation

Random tessellation using Voronoi tiles

Description

voronoi generates n Voronoi tiles (also known as Thiessen polygons) within a polygon using Delaunay triangulation. It is essentially a wrapper for deldir::deldir() which outputs a tidy sf object.

Usage

voronoi(frame, n, warn_multipart = TRUE)

Arguments

frame

An sf object, or an object that can be converted to sf, within which the tessellation will be performed.

n

Desired number of Voronoi tiles; as long as frame is contiguous (see warn_multipart), the function will always return exactly this number of tiles.

warn_multipart

Logical. Set FALSE to suppress the warning about multipart geometries producing an inconsistent number of tiles.

Value

An sf object containing polygon geometries and an integer unique id.

Examples

frame <- rpolygon()
tiles <- voronoi(frame, 50)
plot(tiles)


joeroe/fieldwalkr documentation built on Feb. 17, 2024, 12:15 a.m.