[R] Find characters in a matrix and return a TRUE-FALSE vector

From: Vitrifizierung <Vitrifizierung_at_web.de>
Date: Wed, 13 Apr 2011 04:17:27 -0700 (PDT)


I have the following problem:

My data is a matrix of multiple columns and rows. The column I am interested in looks like that (I think it is a column in a matrix that contains a vector each?):

[[1]]
[1] A B C
[4] D E

[[2]]
[1] A D E

[[3]]
[1] C E F
[4] G

I now want to look for a special word (for example C; in my case the single entries are words, not single letters) and return a vector, like

[1] TRUE FALSE TRUE
Is there an easy way to do it?
Sorry, I am really a beginner and I did not really solve the problem by looking into other threads...

Thanks a lot,
Nina

--
View this message in context: http://r.789695.n4.nabble.com/Find-characters-in-a-matrix-and-return-a-TRUE-FALSE-vector-tp3446868p3446868.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.
Received on Wed 13 Apr 2011 - 14:34:43 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 Wed 13 Apr 2011 - 15:00:29 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