Learn R Programming

IRanges (version 2.6.1)

RleViews-class: The RleViews class

Description

The RleViews class is the basic container for storing a set of views (start/end locations) on the same Rle object.

Arguments

Details

An RleViews object contains a set of views (start/end locations) on the same Rle object called "the subject vector" or simply "the subject". Each view is defined by its start and end locations: both are integers such that start <= end.="" an="" rleviews="" object="" is="" in="" fact="" a="" particular="" case="" of="" Views object (the RleViews class contains the Views class) so it can be manipulated in a similar manner: see ?Views for more information. Note that two views can overlap and that a view can be "out of limits" i.e. it can start before the first element of the subject or/and end after its last element.

See Also

Views-class, Rle-class, view-summarization-methods

Examples

Run this code
  subject <- Rle(rep(c(3L, 2L, 18L, 0L), c(3,2,1,5)))
  myViews <- Views(subject, 3:0, 5:8)
  myViews
  subject(myViews)
  length(myViews)
  start(myViews)
  end(myViews)
  width(myViews)
  myViews[[2]]

  set.seed(0)
  vec <- Rle(sample(0:2, 20, replace = TRUE))
  vec
  Views(vec, vec > 0)

Run the code above in your browser using DataLab