find_consecutive_seq {BALCONY}R Documentation

Find sequences of numbers in a numeric vector

Description

This function finds sequences of consecutive numbers in numeric vectors

Usage

find_consecutive_seq(vector)

Arguments

vector

A numeric vector to be analyzed

Details

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

Value

values

A vector of values starting the consecutive sequences

lengths

A vector of lengths of identified sequences

Author(s)

Michal Stolarczyk & Alicja Pluciennik

Examples

find_consecutive_seq(c(1,2,3,4,5,6,7,20,21,140,141,300,301,302))

[Package BALCONY version 0.2.10 Index]