seqToIntervals {R.utils} | R Documentation |
Gets all contigous intervals of a vector of indices.
## Default S3 method: seqToIntervals(idx, ...)
idx |
A vector of integer indices. |
... |
Not used. |
Henrik Bengtsson (http://www.braju.com/R/)
print(seqToIntervals(1:10)) # [1 10] print(seqToIntervals(c(1:10, 15:18, 20))) # [1 10; 15 18; 20 20]