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

Vitrifizierung Vitrifizierung at web.de
Wed Apr 13 13:17:27 CEST 2011


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.



More information about the R-help mailing list