Learn R Programming

cubar (version 1.1.0)

slide: slide window interval generator

Description

slide generates a data.table with start, center, and end columns for a sliding window analysis.

Usage

slide(from, to, step = 1, before = 0, after = 0)

Value

data.table with start, center, and end columns

Arguments

from

integer, the start of the sequence

to

integer, the end of the sequence

step

integer, the step size

before

integer, the number of values before the center of a window

after

integer, the number of values after the center of a window

Examples

Run this code
slide(1, 10, step = 2, before = 1, after = 1)

Run the code above in your browser using DataLab