tests/testthat/test-plot_temporal.R

test_that("temporal plot is returned in the correct format", {
  expect_type(peak_temporal_plots, "list")
  expect_equal(class(peak_temporal_plots$Baseline), c("gg", "ggplot"))
  # one plot per scenario
  expect_equal(length(peak_temporal_plots), length(psa_data))
})

test_that("the first argument is not a data.frame or list of data.frames", {
  expect_error(
    plot_temporal(c(1:10), D),
    class = "data_type"
  )
})

Try the DUToolkit package in your browser

Any scripts or data that you put into this service are public.

DUToolkit documentation built on Sept. 14, 2025, 5:09 p.m.