seqToIntervals {R.utils}R Documentation

Gets all contigous intervals of a vector of indices

Description

Gets all contigous intervals of a vector of indices.

Usage

## Default S3 method:
seqToIntervals(idx, ...)

Arguments

idx A vector of integer indices.
... Not used.

Author(s)

Henrik Bengtsson (http://www.braju.com/R/)

Examples

  print(seqToIntervals(1:10))  # [1 10]
  print(seqToIntervals(c(1:10, 15:18, 20)))  # [1 10; 15 18; 20 20]

[Package R.utils version 1.0.1 Index]