[R] frequence of patterns in a vector

liujb liujulia7 at yahoo.com
Fri May 29 20:15:04 CEST 2009


Dear R users,

Suppose I have a vector that consists of characters like ABC, A02, RCA,
etc., and there are about 700 of possible characters. For example,
x <- c("ABC", "ABC", "ABC", "A02", "ABC", "RCA", "ABC", "ABC")

I'd like to get a frequency matrix that looks something like this:
ABC   6
A02   1
RCA   1

I have like 1M numbers of vectors like x (that can have different length
too). How do I do this? 

Thank you very much in advance,

Julia 


-- 
View this message in context: http://www.nabble.com/frequence-of-patterns-in-a-vector-tp23784777p23784777.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list