slice-methods: Slice a vector-like or list-like object
Description
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.
Usage
slice(x, lower=-Inf, upper=Inf, ...)
## S3 method for class 'Rle':
slice(x, lower=-Inf, upper=Inf,
includeLower=TRUE, includeUpper=TRUE, rangesOnly=FALSE)
## S3 method for class 'RleList':
slice(x, lower=-Inf, upper=Inf,
includeLower=TRUE, includeUpper=TRUE, rangesOnly=FALSE)
Arguments
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.
Value
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.
Details
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}`