| Rle-class-leftovers {IRanges} | R Documentation |
Rle objects (old man page)
Description
IMPORTANT NOTE - 7/3/2014: This man page is being refactored. Most of the things that used to be documented here have been moved to the man page for Rle objects located in the S4Vectors package.
Coercion
In the code snippets below, from is an Rle object:
as(from, "IRanges"):Creates an IRanges instance from a logical Rle. Note that this instance is guaranteed to be normal.
as(from, "NormalIRanges"):Creates a NormalIRanges instance from a logical Rle.
General Methods
In the code snippets below, x is an Rle object:
split(x, f, drop=FALSE):-
Splits
xaccording tofto create a CompressedRleList object. Iffis a list-like object thendropis ignored andfis treated as if it wasrep(seq_len(length(f)), sapply(f, length)), so the returned object has the same shape asf(it also receives the names off). Otherwise, iffis not a list-like object, empty list elements are removed from the returned object ifdropisTRUE. findRange(x, vec):-
Returns an IRanges object representing the ranges in Rle
vecthat are referenced by the indices in the integer vectorx. splitRanges(x):-
Returns a CompressedIRangesList object that contains the ranges for each of the unique run values.
See Also
The Rle class defined and documented in the S4Vectors package.
Examples
x <- Rle(10:1, 1:10)
x