Description Usage Arguments Value Author(s) Examples
Uses Voronoi tessellation to find nearest neighbours and their respective distances. The neighbours are found using R package deldir.
1 | voronoi_adjacency(data, formula, scale = 1, PLOT = FALSE)
|
data |
(data frame) with id and x, y columns |
formula |
a formula of the form id~x+y |
scale |
scale (divide) coordinates by this factor |
PLOT |
(boolean) plot neighbour links when TRUE. |
list with components Adjacencies - adjacency matrix (TRUE means there is a neighbour). Distances - adjacency matrix with distances between neighbours. NumNeighbours - total number of neighbours.
Barry Rowlingson, Alison Hale
1 2 | data=data.frame(i=1:6, x=c(1,2,1,3,4,8),y=c(1,1,5,5,4,8))
a=voronoi_adjacency(data,i~x+y)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.