nbtest {prabclus}R Documentation

Test of neighborhood list

Description

Tests a list of neighboring regions for proper format. Neighborhood is tested for being symmetrical. Causes an error if tests fail.

Usage

nbtest(nblist, n.regions=length(nblist))

Arguments

nblist A list with a component for every region. The components are vectors of integers indicating neighboring regions. A region without neighbors (e.g., an island) should be assigned a vector numeric(0).
n.regions Number of regions.

Value

invisible{TRUE}.

Author(s)

Christian Hennig hennig@math.uni-hamburg.de http://www.math.uni-hamburg.de/home/hennig/

See Also

prabinit.

Examples

data(nb)
# Note: If you do not use the installed package, replace this by
# nb <- list()
# for (i in 1:34)
#   nb <- c(nb,list(scan(file="(path/)nb.dat",
#                   skip=i-1,nlines=1)))
nbtest(nb)
nb[[1]][1] <- 1
try(nbtest(nb))

[Package Contents]