[R] function which returns number of occurrences of a pattern in string

Mark Sharp msharp at txbiomed.org
Fri Oct 21 00:02:10 CEST 2016


Jan,

Within the stringr package you can find the function str_count().

Mark


R. Mark Sharp, Ph.D.
Director of Primate Records Database
Southwest National Primate Research Center
Texas Biomedical Research Institute
P.O. Box 760549
San Antonio, TX 78245-0549
Telephone: (210)258-9476
e-mail: msharp at TxBiomed.org







> On Oct 20, 2016, at 4:47 PM, Jan Kacaba <jan.kacaba at gmail.com> wrote:
>
> Hello dear R-help
>
> I tried to find function which returns number of occurrences of a pattern
> in string. The closest match I've found is str_locate_all in stringr
> package. I can use str_locate_all but write my function but I don't want
> reinvent wheel.
>
> JK
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

CONFIDENTIALITY NOTICE: This e-mail and any files and/or...{{dropped:10}}



More information about the R-help mailing list