tests/testthat/test-graph.R

# A unit test for graph.R
if (require(testthat)) {
  test_that("Tests for seasonplot()", {
    expect_error(seasonplot(airmiles))
    seasonplot(ts(gold, frequency = 7))
    seasonplot(woolyrnq)
    seasonplot(wineind)
    seasonplot(wineind, year.labels = TRUE)
    seasonplot(wineind, year.labels.left = TRUE)
    # seasonplot(taylor)
  })

  test_that("Tests for tsdisplay()", {
    expect_silent(tsdisplay(airmiles, ci.type = "ma"))
    expect_silent(tsdisplay(1:20))
    expect_silent(tsdisplay(airmiles, plot.type = "scatter"))
    expect_silent(tsdisplay(airmiles, plot.type = "spectrum"))
  })
}

Try the forecast package in your browser

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

forecast documentation built on Aug. 31, 2023, 5:13 p.m.