Skip to contents

The REDCAP full-order contiguity-constrained agglomeration stopped at k clusters.

Usage

ConstrainedHierarchical(
  X,
  adjacency,
  k,
  linkage = c("ward", "single", "complete", "average")
)

Arguments

X

Attribute matrix (units in rows).

adjacency

0/1 contiguity matrix or list of 1-based neighbour vectors.

k

Number of regions.

linkage

"single", "complete", "average" or "ward".

Value

list(labels (in order of first appearance), merges).

References

Guo, D. (2008). International Journal of Geographical Information Science 22, 801-823.

Examples

ConstrainedHierarchical(matrix(c(0, 0.1, 5, 5.1)), list(2, c(1, 3), c(2, 4), 3), 2)$labels
#> [1] 1 1 2 2