Changes the cluster identifiers in the partition vector to form a consecutive sequence.
Value
A strictly positive integer vector representing the updated partition with consecutive cluster identifiers.
Details
This form is also used by stats::cutree()
.
Two partitions are equivalent if and only if their standardised forms are equal.
Examples
p <- c(2, 3, 1, "a", 2)
standardize_partition(p) # c(1, 2, 3, 4, 1)
#> [1] 1 2 3 4 1