so <- scale(olives[, 3:10])
rr <- replicate(20, {
kmeans(so, 8)$cluster
})
x <- as.data.frame(cbind(olives[, 1:2], rr))
# Area and Region with all 20 clusterings
scpcp(x, sel = "data[,1]", sel.palette = "rgb", col.opt = list(alpha = 0.5))
# reordering via steptile
x2 <- steptile(x)
scpcp(x2, sel = "match(data[,1],levels(.GlobalEnv$x[,1]))", sel.palette = "rgb",
col.opt = list(alpha = 0.5))
# also reordering variables ... (cmat takes about 20-30 seconds)
CM <- cmat(x[, 3:22])
require(seriation)
sM <- get_order(seriate(1 - CM))
x3 <- x2[, c(1, 2, 2 + sM, 23)]
scpcp(x3, sel = "match(data[,1],levels(.GlobalEnv$x[,1]))", sel.palette = "rgb",
col.opt = list(alpha = 0.5))