Prunes the minimum spanning tree of the contiguity graph (edge weight = attribute
distance, Prim's algorithm from start) k - 1 times; each cut takes, over all
current subtrees, the edge whose removal most reduces the within-group
dissimilarity, in decreasing order until both parts respect min_size and
min_weight. The dissimilarity is the sum of Euclidean distances to the group
mean as in the skater function of spdep, or the sum of squared deviations when
squared = TRUE.
Usage
Skater(
X,
adjacency,
k,
min_size = 1,
weights = NULL,
min_weight = NULL,
squared = FALSE,
start = 1
)Arguments
- X
Attribute matrix (units in rows).
- adjacency
0/1 contiguity matrix or list of 1-based neighbour vectors.
- k
Number of regions.
- min_size
Minimum units per region.
- weights
Per-unit weights for
min_weight.- min_weight
Minimum summed weight per region.
- squared
Use squared deviations.
- start
1-based root of Prim's algorithm.
