Skip to content
Prev 243696 / 398506 Next

Arrange elements on a matrix according to rowSums + short 'apply' Q

Hi,

Here is a not so easy way to do your first step, but it works:
MAT2 <- cbind(MAT, rowSums(MAT))
MAT[order(MAT2[,6], decreasing=TRUE),]

For the second, I don't know!

HTH,
Ivan


Le 12/2/2010 09:46, Aaron Polhamus a ?crit :