Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cells

extract info about voronoi cells


Description

This function returns some info about the cells of a voronoi mosaic, including the coordinates of the vertices and the cell area.

Usage

cells(voronoi.obj)

Arguments

voronoi.obj

object of class voronoi

Details

The function calculates the neighbourhood relations between the underlying triangulation and translates it into the neighbourhood relations between the voronoi cells.

Value

retruns a list of lists, one entry for each voronoi cell which contains

cell

cell index

center

cell 'center'

neighbours

neighbour cell indices

nodes

2 times nnb matrix with vertice coordinates

area

cell area

Note

outer cells have area=NA, currently also nodes=NA which is not really useful – to be done later

Author(s)

A. Gebhardt

See Also

Examples

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)

tripack

Triangulation of Irregularly Spaced Data

v1.3-9.1
ACM | file LICENSE
Authors
Fortran code by R. J. Renka. R functions by Albrecht Gebhardt <albrecht.gebhardt@aau.at>. With contributions from Stephen Eglen <stephen@anc.ed.ac.uk>, Sergei Zuyev <sergei@stams.strath.ac.uk> and Denis White <white.denis@epamail.epa.gov>
Initial release
2020-03-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.