cells.RdThis function returns some info about the cells of a voronoi mosaic, including the coordinates of the vertices and the cell area.
cells(voronoi.obj)The function calculates the neighbourhood relations between the underlying triangulation and translates it into the neighbourhood relations between the voronoi cells.
retruns a list of lists, one entry for each voronoi cell which contains
cell index
cell 'center'
neighbour cell indices
2 times nnb matrix with vertice coordinates
cell area
outer cells have area=NA, currently also nodes=NA
which is not really useful – to be done later
data(tritest)
tritest.vm <- voronoi.mosaic(tritest$x,tritest$y)
tritest.cells <- cells(tritest.vm)
# higlight cell 12:
plot(tritest.vm)
polygon(t(tritest.cells[[12]]$nodes),col="green")
# put cell area into cell center:
text(tritest.cells[[12]]$center[1],
tritest.cells[[12]]$center[2],
tritest.cells[[12]]$area)