create_sliding_windows_df | R Documentation |
This unexported helper function is used within plane_shape()
to generate sliding windows from a vector and return a data frame where each row is a subset (a sliding window) of a time series. The length of the each windowed time series (and therefore number of columns) is equal to "window_size". The number of windows is equal to (length(vector) - window_size) + 1
. For example, given a time series of length 38 and a window size of length 4, then there will be 35 windowed time series (rows), with 4 time stamps each (columns).
create_sliding_windows_df(vector, window_size)
vector |
A numeric or integer vector that is the time series to be used to create sliding windows |
window_size |
An integer specifying the size (i.e., number of elements) of the windowed time series desired |
A data.frame
where each row is a subset (a sliding window) of a time series.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.