sections: Identify sections of a vector of consecutive values whose...

View source: R/sections.r

sectionsR Documentation

Identify sections of a vector of consecutive values whose differences does not exceed a buffer

Description

Identify sections of a vector that have the same consecutive value

Usage

sections(x, buffer = 0)

Arguments

x

numeric vector

buffer

value compared with difference between consecutive values. If the absolute difference exceeds the buffer, the values are considered different and not part of the same section.

Author(s)

Nikolai Klibansky

Examples

## Not run: 
x <- sample(c(1,0),100,replace=TRUE)
sections(x=x)

## End(Not run)


nikolaifish/bamExtras documentation built on July 21, 2023, 8:26 a.m.