Description Usage Arguments Value See Also Examples
Create Voronoi polygons based on an inla.mesh
object
and an inla.mesh.segment
object specifying the boundary (edge) of the Voronoi polygons.
1 | makeVoronoiPolygons(mesh, boundary)
|
mesh |
an |
boundary |
an |
An object of SpatialPolygons
class.
Other GIS: bufferMask
, condSim
,
getArea
, getPoints
,
insertRaster
, ll2cart
,
safeMask
, sortPolyData
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # load packages
library(sp)
library(INLA)
# make a SpatialPolygons object
poly <- SpatialPolygons(list(
Polygons(list(Polygon(matrix(c(0, 11, -10, 10, -10, -5, 0, -5), ncol=2, byrow=TRUE))), ID=1)))
# make mesh
mesh <- inla.mesh.2d(
boundary = inla.sp2segment(poly),
max.edge = c(3,5))
# make voronoi polygons
v <- makeVoronoiPolygons(mesh, poly)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.