Skip to content
Prev 349754 / 398513 Next

sort adjacency matrix

Hello,

You should have used ?dput to post your data example.
Since you haven't, I've made up one.

set.seed(4795)
mat <- matrix(sample(0:1, 24, replace = TRUE), nrow = 6)
mat

inx <- order(rowSums(mat), decreasing = TRUE)
mat[inx, ]


Hope this helps,

Rui Barradas

Em 06-04-2015 18:18, Ragia Ibrahim escreveu: