find_consecutive_seq {BALCONY} | R Documentation |
This function finds sequences of consecutive numbers in numeric vectors
find_consecutive_seq(vector)
vector |
A numeric vector to be analyzed |
Out of the following vector: 1,2,3,4,5,6,7,20,21,140,141 the function will find values starting the sequences: 1,20,140 and their lengths 7,2,2 respectively
values |
A vector of values starting the consecutive sequences |
lengths |
A vector of lengths of identified sequences |
Michal Stolarczyk & Alicja Pluciennik
find_consecutive_seq(c(1,2,3,4,5,6,7,20,21,140,141,300,301,302))