find_consecutive_seq: Find sequences of numbers in a numeric vector

Description Usage Arguments Details Value Author(s) Examples

Description

This function finds sequences of consecutive numbers in numeric vectors

Usage

1

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

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

Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 
$values
[1]   1  20 140 300

$lengths
[1] 7 2 2 3

BALCONY documentation built on May 1, 2019, 10:31 p.m.