Learn R Programming

tsibble (version 0.4.0)

stretcher: Splits the input to a list according to the stretching window size.

Description

Splits the input to a list according to the stretching window size.

Usage

stretcher(.x, .size = 1, .init = 1)

pstretcher(..., .size = 1, .init = 1)

Arguments

.x

An object to slide over.

.size

An integer for window size. If positive, moving forward from left to right; if negative, moving backward (from right to left).

.init

A positive integer for an initial window size.

...

Multiple objects to be splitted in parallel.

x

An objects to be splitted.

Examples

Run this code
# NOT RUN {
.x <- 1:5
.y <- 6:10
.z <- 11:15
.lst <- list(x = .x, y = .y, z = .z)
.df <- as.data.frame(.lst)

stretcher(.x, .size = 2)
stretcher(.lst, .size = 2)
pstretcher(.lst, .size = 2)
stretcher(.df, .size = 2)
pstretcher(.df, .df, .size = 2)
# }

Run the code above in your browser using DataLab