Re: [R] Extract from matrix

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Fri, 15 Feb 2008 15:26:55 -0200

Try also:

mat[mat==29] <- NA

On 15/02/2008, _Fede_ <r_stat_solutions_at_hotmail.es> 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.
>
> ______________________________________________
> R-help_at_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.
>

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

______________________________________________
R-help_at_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.
Received on Fri 15 Feb 2008 - 17:34:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 15 Feb 2008 - 18:30:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive