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

Bob Rudis bob at rud.is
Fri Oct 21 03:47:50 CEST 2016


`stringi::stri_count()`

I know that the `stringr` pkg saves some typing (it wraps the
`stringi` pkg), but you should really just use the `stringi` package.
It has many more very useful functions with not too much more typing.

On Thu, Oct 20, 2016 at 5: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.



More information about the R-help mailing list