Description Usage Arguments Value Author(s) See Also Examples
This function reorder the groups in an image matrix in such a way that the blocks with a higher average weigh are placed on the left hand side of the matrix.
1 | orderdClu(res)
|
res |
The object produced by the function |
tclu |
The vector indication to which group a certain unit belongs. |
IMg |
Reordered image matrix. |
Marjan Cugmas, Aleš Žiberna
1 2 3 4 5 6 7 8 9 10 11 12 13 | orderdClu <- function(res){
means<-fun.by.blocks(res, ignore.diag=TRUE)
crit<-colSums(means)+rowSums(means)
r <- order(crit, decreasing = TRUE)
a <- IM(res)[1,,]
a <- a[as.vector(r), as.vector(r)]
IMg <- array(NA, dim = c(1, max(r), max(r)))
(IMg[1,,] <- a)
r<-rank(-crit)
names(r) <- 1:max(clu(res))
tclu <- r[as.character(clu(res))]
return(list(tclu, IMg))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.