Skip to contents

Convert a vector of points into a data.frame of start/end points representing disjoint intervals

Usage

index_to_start_end(p, right = TRUE)

Arguments

p

integer, a vector of points to be broken up into intervals

right

logical, whether the points should represent interval starts (FALSE) or interval ends (TRUE), default TRUE

Value

A data.frame with column: start and end representing the start and end points of the intervals

Examples

if (FALSE) {
index_to_start_end(c(1,5,10))
index_to_start_end(c(1,5,10), right = FALSE)
}