View source: R/get_var_array.R
slice_var_sequence | R Documentation |
Generate a matrix with various lags from a sequence
slice_var_sequence(sequence, lags, label_length = 1, label_output = TRUE)
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 |
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.