Zp <- matrix(rep(0, 100), nrow = 10, ncol = 10)
Zp[2, 2:4] <- 1;
Zp[2:4, 5] <- 2;
Zp[8, 7:10] <- 3;
Zp[9, 6] <- 4; Zp[10, 5] <- 4
Zp[10, 1:4] <- 5
Zp[6:9, 1] <- 6
labelmoments <- labelmoments(Zp, cmax = 6, Sigma = 1.0)
set.seed(12)
mergelabels <- mergelabels(list(labelmoments$A), w = 1.0, k = 2, nstart = 3)
Zp
mergelabels
Run the code above in your browser using DataLab