Re: [R] order matrix regarding its content.

2015-05-23 Thread Ragia Ibrahim
Many thanks > Date: Sat, 23 May 2015 11:55:07 +0200 > From: lig...@statistik.tu-dortmund.de > To: ragi...@hotmail.com; r-help@r-project.org > Subject: Re: [R] order matrix regarding its content. > > > > On 23.05.2015 11:10, Ragia Ibrahim wrote: > > Dear group, &

Re: [R] order matrix regarding its content.

2015-05-23 Thread Uwe Ligges
On 23.05.2015 11:10, Ragia Ibrahim wrote: Dear group, I have the following matrix 1 2 3 4 5 6 7 8 9 10 1 0 1 1 1 1 1 1 1 1 1 2 0 0 0 1 1 0 0 0 0 0 3 0 0 0 1 1 1 1 1 1 1 4 0 0 0 0 1 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 1 1 1 1 7 0 0 0 0 0 0 0 1 1 0 8 0 0 0 0 0 0 0 0 1

Re: [R] order matrix regarding its content.

2015-05-23 Thread Rui Barradas
Hello, Maybe something like the following. (Assuming your matrix is named 'mat') mat[order(rowSums(mat)), ] Hope this helps, Rui Barradas Em 23-05-2015 10:10, Ragia Ibrahim escreveu: Dear group, I have the following matrix 1 2 3 4 5 6 7 8 9 10 1 0 1 1 1 1 1 1 1 1 1 2 0 0 0 1 1 0 0

[R] order matrix regarding its content.

2015-05-23 Thread Ragia Ibrahim
Dear group, I have the following matrix 1 2 3 4 5 6 7 8 9 10 1 0 1 1 1 1 1 1 1 1 1 2 0 0 0 1 1 0 0 0 0 0 3 0 0 0 1 1 1 1 1 1 1 4 0 0 0 0 1 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 1 1 1 1 7 0 0 0 0 0 0 0 1 1 0 8 0 0 0 0 0 0 0 0 1 0 9 1 1 1 1 1 1 1 1 1 1 10 0 0 0 0 0 0 0 0