Is it possible to count a repeating part of a sequence in R? For example:
x<- c(1,3.0,3.1,3.2,1,1,2,3.0,3.1,3.2,4,4,5,6,5,3.0,3.1,3.2,
3.1,2,1,4,6,4.0,4,3.0,3.1,3.2,5,3.2,3.0,4)
Is it possible to count the times that the subsequence 3.0,3.1,3.2 occurs? So in this example it must be: 4