testnb: Test a neighbours list for symmetry

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Checks a neighbours list for symmetry/transitivity (if i is a neighbour of j, then j is a neighbour of i). This holds for distance and contiguity based neighbours, but not for k-nearest neighbours. The helper function sym.attr.nb() calls is.symmetric.nb() to set the sym attribute if needed, and make.sym.nb makes a non-symmetric list symmetric by adding neighbors. is.symmetric.glist checks a list of general weights corresponding to neighbours for symmetry for symmetric neighbours.

Usage

1
2
3
4
5

Arguments

nb

an object of class nb with a list of integer vectors containing neighbour region number ids.

verbose

default NULL, use global option value; if TRUE prints non-matching pairs

force

do not respect a neighbours list sym attribute and test anyway

glist

list of general weights corresponding to neighbours

Value

TRUE if symmetric, FALSE if not; is.symmetric.glist returns a value with an attribute, "d", indicating for failed symmetry the largest failing value.

Note

A new version of make.sym.nb by Bjarke Christensen is now included. The older version has been renamed old.make.sym.nb, and their comparison constitutes a nice demonstration of vectorising speedup using sapply and lapply rather than loops. When any no-neighbour observations are present, old.make.sym.nb is used.

Author(s)

Roger Bivand Roger.Bivand@nhh.no

See Also

read.gal

Examples

1
2
3
4
5
6
7
8
9

spdep documentation built on Aug. 19, 2017, 3:01 a.m.