Learn R Programming

spatgraphs (version 2.62)

spatgraphs-spatgraph: spatgraph

Description

Compute a spatial graph for a given 2D- or 3D- point pattern.

Usage

spatgraph(pp, type="knn", par=NULL, preprocessR=0, dbg=FALSE, 
           doDists=FALSE, preDists=NULL, preGraph=NULL, toroidal=FALSE, include=NULL)

Arguments

pp
Point pattern with members x,y,n,window. Window must have x- and y-limits according to given x,y. see package spatstat, class ppp.
type
One of the supported graph types, see below.
par
Parameter(s) for the graph, see below.
preprocessR
If >0 first compute geometric graph and then the type graph using the preprocessed edgelist. Useful for narrowing down the search space for bigger pp's.
dbg
Boolean, print additional information during the execution.
doDists
Boolean, default FALSE. If true, precompute and store the pairwise distances. Speeds things up quite a lot but takes O(n^2) memory!
preDists
Optional: precalculated distance matrix for the points. Can be used in case of non-standard metric spaces.
preGraph
Precalculated graph to be used as search space for neighbours. Useful for large computation of e.g. Gabriel graphs.
toroidal
Make a toroidal distance calculation. Not useful when visualizing but useful for edge correction in summary calculations.
include
A 0-1-vector describing which points' neighbourhoods to calculate, i.e. include[i]=1 => compute neighbourhood of pp[i].

Value

  • An object of class sg.

Details

The following 'type' values are accepted, note that some of them need also the 'par':

rl{ 'geometric' par=numeric>0. Geometric graph, par = connection range. 'knn' par=integer>0. k-nearest neighbours graph, par = k. 'mass_geometric' Connect two points if ||x-y||par=k: Allow k points in the shared circle between two points. Normal Gabriel equals k=0. 'delaunay' Delaunay triangulation. Note! Only 2D, and no check for collinearity: use rjitter from spatstat if unsure. 'MST' Minimal spanning tree. 'markcross' Connect two points if ||x-y||

If your window is non-convex polygon, you can use clip.sg to cut extra edges that cross the border.

References

Dousse, O., Baccelli, F. & Thiran, P.: Impact of Interferences on Connectivity in Ad Hoc Networks. IEEE/ACM Transactions on Networking,13 (2),p. 425-436,2005.

Marchette, D.: Random Graphs for Statistical Pattern Recognition, Wiley 2004.