Daren Tan <daren76 <at> hotmail.com> writes:
 > Any better solution than this ? 
> sum(strsplit("TCGGGGGACAATCGGTAACCCGTCT", "")[[1]] == "G")

Try

table(strsplit("TCGGGGGACAATCGGTAACCCGTCT", ""))

A C G T 
5 7 8 5 
 and get all 4 at once.

HTH

-- 
Ken Knoblauch
Inserm U846
Institut Cellule Souche et Cerveau
Département Neurosciences Intégratives
18 avenue du Doyen Lépine
69500 Bron
France
tel: +33 (0)4 72 91 34 77
fax: +33 (0)4 72 91 34 61
portable: +33 (0)6 84 10 64 10
http://www.sbri.fr

______________________________________________
R-help@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.

Reply via email to