How to find number of repeated values in r. the number of consecutive repeats within each run.