slice-methods | R Documentation |
slice
is a generic function that creates views on a vector-like
or list-like object that contain the elements that are within the
specified bounds.
slice(x, lower=-Inf, upper=Inf, ...)
## S4 method for signature 'Rle'
slice(x, lower=-Inf, upper=Inf,
includeLower=TRUE, includeUpper=TRUE, rangesOnly=FALSE)
## S4 method for signature 'RleList'
slice(x, lower=-Inf, upper=Inf,
includeLower=TRUE, includeUpper=TRUE, rangesOnly=FALSE)
x |
An Rle or RleList object, or any object coercible to an Rle object. |
lower , upper |
The lower and upper bounds for the slice. |
includeLower , includeUpper |
Logical indicating whether or not the specified boundary is open or closed. |
rangesOnly |
A logical indicating whether or not to drop the original data from the output. |
... |
Additional arguments to be passed to specific methods. |
slice
is useful for finding areas of absolute maxima (peaks),
absolute minima (troughs), or fluctuations within specified limits.
One or more view summarization methods can be used on the result of
slice
. See ?`link{view-summarization-methods}`
The method for Rle objects returns an RleViews object
if rangesOnly=FALSE
or an IRanges object if
rangesOnly=TRUE
.
The method for RleList objects returns an RleViewsList object
if rangesOnly=FALSE
or an IRangesList object if
rangesOnly=TRUE
.
P. Aboyoun
view-summarization-methods for summarizing the views
returned by slice
.
slice-methods in the XVector package
for more slice
methods.
coverage
for computing the coverage across a set
of ranges.
The Rle, RleList, RleViews, and RleViewsList classes.
## Views derived from coverage
x <- IRanges(start=c(1L, 9L, 4L, 1L, 5L, 10L),
width=c(5L, 6L, 3L, 4L, 3L, 3L))
cvg <- coverage(x)
slice(cvg, lower=2)
slice(cvg, lower=2, rangesOnly=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.