Debian Codegraph @

tests/testthat/test-stats-time-series.R

raw
1 skip_if_not_installed("modeltests")
2 library(modeltests)
3
4 test_that("tidy.acf works", {
5 check_arguments(tidy.acf)
6
7 result <- acf(lh, plot = FALSE)
8 td <- tidy(result)
9 check_tidy_output(td)
10 check_dims(td, 17, 2)
11 })
12
13
14 test_that("tidy.ts", {
15 check_arguments(tidy.ts)
16
17 x <- ts(1:10, frequency = 4, start = c(1959, 2))
18 td <- tidy(x)
19 check_tidy_output(td)
20
21 z <- ts(matrix(rnorm(300), 100, 3), start = c(1961, 1), frequency = 12)
22 td2 <- tidy(z)
23 check_tidy_output(td2)
24 })
25
26
27 test_that("tidy.spec", {
28 check_arguments(tidy.spec)
29
30 spc <- spectrum(lh, plot = FALSE)
31 td <- tidy(spc)
32
33 check_tidy_output(td, strict = FALSE)
34 check_dims(td, 24, 2)
35 })