tsibble (version 0.8.2)

tiler: Splits the input to a list according to the tiling window size.

Description

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

Usage

tiler(.x, .size = 1, .bind = FALSE)

ptiler(..., .size = 1, .bind = FALSE)

Arguments

.x

An objects to be split.

.size

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

.bind

If .x is a list or data frame, the input will be flattened to a list of data frames.

...

Multiple objects to be split in parallel.

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)

tiler(x, .size = 2)
tiler(lst, .size = 2)
ptiler(lst, .size = 2)
ptiler(list(x, y), list(y))
ptiler(df, .size = 2)
ptiler(df, df, .size = 2)
# }

Run the code above in your browser using DataLab