voronoi_adjacency: Find neighbours using Voronoi tessellation.

Description Usage Arguments Value Author(s) Examples

View source: R/adjacencies.R

Description

Uses Voronoi tessellation to find nearest neighbours and their respective distances. The neighbours are found using R package deldir.

Usage

1

Arguments

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.

Value

list with components Adjacencies - adjacency matrix (TRUE means there is a neighbour). Distances - adjacency matrix with distances between neighbours. NumNeighbours - total number of neighbours.

Author(s)

Barry Rowlingson, Alison Hale

Examples

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)

barryrowlingson/caramellar documentation built on May 29, 2019, 4:50 p.m.