mosaic | R Documentation |
mosaic
generates polygon units within a sample frame using a stochastic
tessellation algorithm. The desired number of units can be specified as an
exact density
or an average unit area
.
mosaic(frame, density = NULL, area = NULL, method = voronoi)
frame |
An |
density |
An integer specifying the desired number of units to be
generated within the sample frame. Not required if |
area |
An integer or double specifying the desired average
area of each unit. The units are assumed to match those
given by |
method |
The tessellation model to be used to generate the mosaic; see details. |
method
accepts a function describing the tessalation model to be used (see
\insertCiteVan_Lieshout2012-hbfieldwalkr for an overview). Currently the
only method implemented in the package is voronoi()
, which generates a
Voronoi tessellation using a set of uniformly distributed random points and
Delaunay triangulation.
An sf
object containing the units as polygons with an integer id
.
Van_Lieshout2012-hbfieldwalkr
frame <- rpolygon()
# Fixed number of units using Voronoi tesselation
units <- mosaic(frame, density = 50, method = voronoi)
plot(units)
# Average unit area
units <- mosaic(frame, area = 20000, method = voronoi)
plot(units)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.