[R] how to count the total number of (INCLUDING overlapping) occurrences of a substring within a string?

Hans W Borchers hwborchers at googlemail.com
Sun Dec 20 15:42:01 CET 2009


Hans W Borchers <hwborchers <at> googlemail.com> writes:
>

Sorry, my fault. I forgot the brackets. With

    gregexpr("(.)(?=.\\1)", "ababacababab", perl = TRUE)

it works as you suggested.

Thanks
Hans Werner




More information about the R-help mailing list