Learn R Programming

IRanges (version 2.4.1)

Rle-class-leftovers: 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.

Arguments

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:
window(x, start=NA, end=NA, width=NA): Extract the subsequence window from x specified by:
start, end, width
The start, end, or width of the window. Two of the three are required.
window(x, start=NA, end=NA, width=NA) <- value: Replace the subsequence window specified on the left (i.e. the subsequence in x specified by start, end and width) by value. value must either be of class Rle, belong to a subclass of Rle, or be coercible to Rle or a subclass of Rle. The elements of value are repeated to create an Rle with the same number of elements as the width of the subsequence window it is replacing.
split(x, f, drop=FALSE): Splits x according to f to create a CompressedRleList object. If f is a list-like object then drop is ignored and f is treated as if it was rep(seq_len(length(f)), sapply(f, length)), so the returned object has the same shape as f (it also receives the names of f). Otherwise, if f is not a list-like object, empty list elements are removed from the returned object if drop is TRUE.
findRange(x, vec): Returns an IRanges object representing the ranges in Rle vec that are referenced by the indices in the integer vector x.
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

Run this code
x <- Rle(10:1, 1:10)
x

window(x, 4, 14)

Run the code above in your browser using DataLab