Look this can help you: mtz<-matrix(1:20,4,5) > mtz [,1] [,2] [,3] [,4] [,5] [1,] 1 5 9 13 17 [2,] 2 6 10 14 18 [3,] 3 7 11 15 19 [4,] 4 8 12 16 20 > mtz[2,3] [1] 10 > mtz [,1] [,2] [,3] [,4] [,5] [1,] 1 5 9 13 17 [2,] 2 6 10 14 18 [3,] 3 7 11 15 19 [4,] 4 8 12 16 20 > mtz[2,3]<-NA > mtz [,1] [,2] [,3] [,4] [,5] [1,] 1 5 9 13 17 [2,] 2 6 NA 14 18 [3,] 3 7 11 15 19 [4,] 4 8 12 16 20 Best rgrds
*-------------------------------------* * * *J. Arturo Coral Alamo* Consultor Business Analytics SAC Telf: (51-1) 222-4091 Cel: (51-1) 903-56370 RPM #376-870 Cel: (51-1) 911-10624 On Fri, Feb 15, 2008 at 11:10 AM, _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 example if I have this matrix X: > > [,1] [,2] [,3] [,4] > [1,] 3 13 23 33 > [2,] 9 19 29 39 > [3,] 10 20 30 40 > > I can do X[-2] or X[2] in order to eliminate the element of the matrix or > to > extract it, respectively. > > But, what I need is to extract or to eliminate a value of the matrix. For > example the 29. > > Can I do this? How? > > Thanks for the help. > -- > View this message in context: > http://www.nabble.com/Extract-from-matrix-tp15502655p15502655.html > Sent from the R help mailing list archive at Nabble.com<http://nabble.com/> > . > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > -- Saludos cordiales J Arturo Coral [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.