orderdClu {nem}R Documentation

Ordered clusters in a matrix network representation

Description

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.

Usage

orderdClu(res)

Arguments

res

The object produced by the function oprRandParC from blockmodeling package.

Value

tclu

The vector indication to which group a certain unit belongs.

IMg

Reordered image matrix.

Author(s)

Marjan Cugmas, Aleš Žiberna

See Also

orderedIM

Examples

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))
}

[Package nem version 0.12.33 Index]