library(tidyverse)
library(timetk)
# ---- SINGLE TIME SERIES DECOMPOSITION ----
m4_hourly %>%
filter(id == "H10") %>%
plot_stl_diagnostics(
date, value,
# Set features to return, desired frequency and trend
.feature_set = c("observed", "season", "trend", "remainder"),
.frequency = "24 hours",
.trend = "1 week",
.interactive = FALSE)
# ---- GROUPS ----
m4_hourly %>%
group_by(id) %>%
plot_stl_diagnostics(
date, value,
.feature_set = c("observed", "season", "trend"),
.interactive = FALSE)
Run the code above in your browser using DataLab