test_that("errors on incorrect input", {
expect_error(plot_anomaly_decomposition(3))
})
test_that("returns a ggplot", {
expect_snapshot(
g <- tidyverse_cran_downloads %>%
dplyr::filter(package == "tidyquant") %>%
dplyr::ungroup() %>%
time_decompose(count, method = "stl") %>%
anomalize(remainder, method = "iqr")
)
expect_s3_class(plot_anomaly_decomposition(g), "ggplot")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.