Skip to contents

Contiguity-constrained agglomeration (clusters merge only when contiguous; the linkage runs over all member pairs, or over the contiguity edges between them for order = "first") builds a spanning tree from the shortest contiguity edge of each merge; the tree is cut k - 1 times at the edge of largest reduction in the sum of squared deviations. Single, complete and Ward linkage use squared Euclidean distances and average linkage Euclidean distances (the GeoDa convention).

Usage

Redcap(
  X,
  adjacency,
  k,
  linkage = c("complete", "single", "average", "ward"),
  order = c("full", "first"),
  min_size = 1,
  weights = NULL,
  min_weight = NULL
)

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".

order

"full" or "first" (first-order needs single linkage).

min_size

Minimum units per region.

weights

Per-unit weights for min_weight.

min_weight

Minimum summed weight per region.

Value

list(labels, tree, ssd, n_regions).

References

Guo, D. (2008). Regionalization with dynamically constrained agglomerative clustering and partitioning (REDCAP). International Journal of Geographical Information Science 22, 801-823.

Examples

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