windows: Map a function over an Rle in windows

Description Usage Arguments Details Examples

Description

Map a function over an Rle in windows

Usage

1
2
3
4
5
tile_rle(.x, .size = 1L, .fun, ...)

stretch_rle(.x, .size = 1L, .step = 1L, .fun, ...)

roll_rle(.x, .size = 1L, .step = 1L, .fun, ...)

Arguments

.x

An atomic vector or Rle object.

.size

The (integer) size of the window.

.fun

A function

...

Additional arguments passed on to the mapped function

.step

The (integer) amount to shift the start of the window by.

Details

The map functions apply a function over non-overlapping windows [tile_rle()], overlapping windows [roll_rle()], and windows with a fixed start but increasing width stretch_rle()

Examples

1
2
3
4
x <- S4Vectors::Rle(1:10, 1:10)
tile_rle(x, .size = 2, mean)
roll_rle(x, .size = 2, .step = 1, mean)
stretch_rle(x, .size = 1, .step = 2, mean)

sa-lee/superintronic documentation built on Feb. 18, 2020, 10:36 a.m.