aggregate(x, FUN = mean, start = 1:(length(x) - 50), end = 51:length(x))
z <- c("the", "quick", "red", "fox", "jumps", "over", "the", "lazy", "brown", "dog")
.naive_runsum <- function(x, k, na.rm=FALSE)
function(offset) sum(x[1:k + offset], na.rm=na.rm))
target1 <- .naive_runsum(x0, 3, na.rm = TRUE)
target2 <- .naive_runsum(x, 3, na.rm = TRUE)
current <- as.vector(runsum(x, 3, na.rm = TRUE))
runq(x, k = 3, i = 1, na.rm = TRUE) ## smallest value in window
runq(x, k = 3, i = 3, na.rm = TRUE) ## largest value in window

### Aliases: class:RleViews RleViews-class RleViews Views,Rle-method

vec <- Rle(sample(0:2, 20, replace = TRUE))

rleViews2 <- Views(subject2, subject2 > 0)
rangesList <- IRangesList(IRanges(3:0, 5:8), IRanges(subject2 > 0))
method2 <- RleViewsList(rleList = rleList, rangesList = rangesList)

### Title: Fixed width running window summaries across vector-like objects
### Aliases: runstat runsum runmean runwtsum runq

runq(x, k = 5, i = 3, endrule = "constant")
runwtsum(x, k = 2, wt =  c(0.25, 0.5), na.rm = TRUE)
runq(x, k = 2, i = 2, na.rm = TRUE) ## max value in window

### Title: Apply function and cast to Vector
### Aliases: seqapply mseqapply tseqapply seqsplit seqby

rangesList <- mseqapply(IRanges, starts, ends)
rangeDataFrame <- stack(rangesList, "space", "ranges")

### Title: Set operations on IRanges, RangesList, and Hits objects
## Element-wise (aka "parallel") operations:

irl2 <- IRangesList(c = IRanges(c(0,2),c(4,5)), a = IRanges(c(4,5),c(6,7)))

### Title: Simple and Compressed List Classes
### Aliases: SimpleList SimpleList-class CompressedList

SimpleList(a = letters, ranges = IRanges(1:10, 1:10))

### Title: Slice a vector-like or list-like object
### Aliases: slice-methods slice slice,Rle-method slice,RleList-method

x <- IRanges(start=c(1L, 9L, 4L, 1L, 5L, 10L),

### Title: Some utility functions to operate on strings
### Aliases: unstrsplit unstrsplit,list-method safeExplode
## In other words: strsplit() behavior sucks :-/
## In normal situations (i.e. when the input is well-formed),
## strsplitAsListOfIntegerVectors() does actually the same as the
## function below but is more efficient (both in speed and memory