Hello all,
I have a matrix object, xx given as below:
[,1] [,2]
[1,] 0.02237883 0.601572660
[2,] -0.39880918 0.126498958
[3,] 0.20269214 0.567953402
[4,] -0.45750812 -0.031193600
[5,] -0.30666134 -0.084819484
[6,] -0.37718928 0.078675868
[7,] -0.25432685
Something like this should work:
which(rowSums(xx 0) == ncol(xx))
Andy
From: Akkineni,Vasundhara
Hello all,
I have a matrix object, xx given as below:
[,1] [,2]
[1,] 0.02237883 0.601572660
[2,] -0.39880918 0.126498958
[3,] 0.20269214 0.567953402
[4,]
PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Akkineni,Vasundhara
Sent: Sunday, March 26, 2006 11:49 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Matrix elements
Hello all,
I have a matrix object, xx given as below:
[,1] [,2]
[1,] 0.02237883 0.601572660
[2,] -0.39880918
: Sunday, March 26, 2006 11:49 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Matrix elements
Hello all,
I have a matrix object, xx given as below:
[,1] [,2]
[1,] 0.02237883 0.601572660
[2,] -0.39880918 0.126498958
[3,] 0.20269214 0.567953402
[4,] -0.45750812 -0.031193600
Try this:
which(xx[,1] 0 xx[,2] 0)
On 3/26/06, Akkineni,Vasundhara [EMAIL PROTECTED] wrote:
Hello all,
I have a matrix object, xx given as below:
[,1] [,2]
[1,] 0.02237883 0.601572660
[2,] -0.39880918 0.126498958
[3,] 0.20269214 0.567953402
[4,]
Gabor Grothendieck wrote:
Try this:
which(xx[,1] 0 xx[,2] 0)
... or more generally for an arbitrary number of columns:
which(apply(xx 0, 1, all))
Uwe Ligges
On 3/26/06, Akkineni,Vasundhara [EMAIL PROTECTED] wrote:
Hello all,
I have a matrix object, xx given as below: