Re: [R] Extract from matrix

2008-02-16 Thread _Fede_
Thank you all for your help. Fede _Fede_ wrote: > > Hi all. > > I have certain problem with the extraction of data from matrices. I know > how extract elements from a matrix, but what I would like to do is to > extract a concrete number, not an element. For example if I have this > matrix X:

Re: [R] Extract from matrix

2008-02-15 Thread John Kane
?which Does something like this help? which(aa==29) aa[ -which(aa==29)] --- _Fede_ <[EMAIL PROTECTED]> wrote: > > Hi all. > > I have certain problem with the extraction of data > from matrices. I know how > extract elements from a matrix, but what I would > like to do is to extract a > concr

Re: [R] Extract from matrix

2008-02-15 Thread Henrique Dallazuanna
Try also: mat[mat==29] <- NA On 15/02/2008, _Fede_ <[EMAIL PROTECTED]> wrote: > > Hi all. > > I have certain problem with the extraction of data from matrices. I know how > extract elements from a matrix, but what I would like to do is to extract a > concrete number, not an element. For examp

Re: [R] Extract from matrix

2008-02-15 Thread J. Arturo Coral Alamo
Look this can help you: mtz<-matrix(1:20,4,5) > mtz [,1] [,2] [,3] [,4] [,5] [1,]159 13 17 [2,]26 10 14 18 [3,]37 11 15 19 [4,]48 12 16 20 > mtz[2,3] [1] 10 > mtz [,1] [,2] [,3] [,4] [,5] [1,]159 13 17 [2,]2

Re: [R] Extract from matrix

2008-02-15 Thread Gavin Simpson
On Fri, 2008-02-15 at 08:10 -0800, _Fede_ wrote: > Hi all. > > I have certain problem with the extraction of data from matrices. I know how > extract elements from a matrix, but what I would like to do is to extract a > concrete number, not an element. For example if I have this matrix X: > >

[R] Extract from matrix

2008-02-15 Thread _Fede_
Hi all. I have certain problem with the extraction of data from matrices. I know how extract elements from a matrix, but what I would like to do is to extract a concrete number, not an element. For example if I have this matrix X: [,1] [,2] [,3] [,4] [1,]3 13 23 33 [2,]9 19