slice_var_sequence {long2lstmarray} | R Documentation |
Generate a matrix with various lags from a sequence
Description
Generate a matrix with various lags from a sequence
Usage
slice_var_sequence(sequence, lags, label_length = 1, label_output = TRUE)
Arguments
sequence |
A vector representing the sequence to be sliced into many rows. |
lags |
The length of each sliced sequence. |
label_length |
How many values after are
considered to be the label? Default to 1.
If |
label_output |
logical. if |
Value
If label_output
is FALSE
, a matrix with
the sliced sequences is returned.
If label_output
is TRUE
, a list with
the matrix and vector with
the labels is returned.
Examples
slice_var_sequence(sequence = 1:30,
lags = 3, label_length = 1,
label_output = TRUE)
slice_var_sequence(sequence = 1:30,
lags = 3, label_length = 1,
label_output = FALSE)
slice_var_sequence(sequence = 1:30,
lags = 3, label_length = 2,
label_output = FALSE)
[Package long2lstmarray version 0.2.0 Index]