0
I would like to know how to count sequences of different within a vector containing only 0
and 1
.
For example, in the vector
x <- c(1, 1, 1, 0, 0, 0, 1, 1)
the count would give the vector 3
why he counts equal sequence.
"1, 1, 1", "0, 0, 0", "1, 1" = 3
Can you specify your question better? Are you using any specific language? How is the data structure (more practical) you get to validate?
– GustavoAdolfo
@Breno, you’ve solved the problem?
– rLinhares