[R] R string functions

Daniel Malter daniel at umd.edu
Wed Jun 15 23:02:59 CEST 2011


x<-'GTTACTGGTACC'
table(strsplit(x,''))

hth,
Daniel


karena wrote:
> 
> Hi, 
> 
> I have a string "GGGGGGCCCAATCGCAATTCCAATT"
> 
> What I want to do is to count the percentage of each letter in the string,
> what string functions can I use to count the number of each letter
> appearing in the string?
> 
> For example, the letter "A" appeared 6 times, letter "T" appeared 5 times,
> how can I use a string function to get the these number?
> 
> thanks,
> 
> karena
> 

--
View this message in context: http://r.789695.n4.nabble.com/R-string-functions-tp3600484p3600568.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list