# Plot Anomalies
library(dplyr)
walmart_sales_weekly %>%
filter(id %in% c("1_1", "1_3")) %>%
group_by(id) %>%
anomalize(Date, Weekly_Sales) %>%
plot_anomalies(Date, .facet_ncol = 2, .ribbon_alpha = 0.25, .interactive = FALSE)
# Plot Anomalies Decomposition
library(dplyr)
walmart_sales_weekly %>%
filter(id %in% c("1_1", "1_3")) %>%
group_by(id) %>%
anomalize(Date, Weekly_Sales, .message = FALSE) %>%
plot_anomalies_decomp(Date, .interactive = FALSE)
# Plot Anomalies Cleaned
library(dplyr)
walmart_sales_weekly %>%
filter(id %in% c("1_1", "1_3")) %>%
group_by(id) %>%
anomalize(Date, Weekly_Sales, .message = FALSE) %>%
plot_anomalies_cleaned(Date, .facet_ncol = 2, .interactive = FALSE)
Run the code above in your browser using DataLab