Description Usage Arguments Details Value Author(s) Examples
Using an initial set of points, create some wiggly boundaries that look a bit like natural regional boundaries.
1 | fakeRegions(n = 30, pts = cbind(runif(n), runif(n)), boundary = pts[chull(pts), ], clipmode = 0)
|
n |
The number of initial points. If only this argument is given, then n points on a unit square are the initial points. |
pts |
The initial seed points. |
boundary |
A boundary for clipping or cutting as a gpc.poly object. |
clipmode |
How to clip the polygons to the bounday. See details. |
The process is as follows. Create Voronoi tiles using the points as seeds. Take all the finite edges and wiggle them. Create polygons from those wiggly edges. Clip the polygons to the boundary polygon object.
If clipmode is 0, no clipping is done and all polygons are returned.
If clipmode = 1, any polygons that are partly within the boundary are returned.
If clipmode = 2, polygons are clipped to the boundary polygon.
If clipmode = 3, only polygons that are fully within the boundary are returned.
A list with the following components:
polys |
A list of GPC Polygon objects for the regions. |
bounds |
The clipping polygon used |
points |
The seed points used |
box |
The bounding box of the polygons |
Barry Rowlingson
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.