| make_tsibble | R Documentation |
Convert a tibble containing time series data to a tsibble.
make_tsibble(main_frame, context)
main_frame |
A |
context |
A named |
make_tsibble() is a small helper for time series cross-validation
workflows. It uses the time index and series identifier supplied in
context to create a regular tsibble.
The input data must contain the columns specified by context$index_id
and context$series_id. The column specified by context$index_id
is used as the time index, and the column specified by
context$series_id is used as the key.
A tsibble with the same columns as main_frame, using the index
and key defined in context.
Other time series cross-validation:
make_future(),
make_split(),
slice_test(),
slice_train(),
split_index()
library(dplyr)
library(tsibble)
context <- list(
series_id = "series",
value_id = "value",
index_id = "index"
)
main_frame <- M4_monthly_data |>
filter(series %in% c("M23100", "M14395"))
tsibble_frame <- make_tsibble(
main_frame = main_frame,
context = context
)
tsibble_frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.