tests/testthat/test-split_ts.R

# A unit test for split_ts function
if(require(testthat)){

  test_that("tests for some arguments in split_ts", {
    result <- split_ts(retail_wide[,1], test_size = 2)

    result <- as.numeric(result$test)

    expect_that(result, equals(c(409.4, 583.6)))

  })
}

Try the caretForecast package in your browser

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

caretForecast documentation built on Oct. 24, 2022, 9:07 a.m.