tests/testthat/test-examples-fastcpd_lasso.R

testthat::test_that(
  "examples/fastcpd_lasso.txt", {
    testthat::skip_if_not_installed("dplyr")
    testthat::skip_if_not_installed("ggplot2")
    testthat::skip_if_not_installed("mvtnorm")
    testthat::skip_if_not_installed("reshape2")

    examples_lasso <- readLines("examples/fastcpd_lasso.txt")
    source(textConnection(paste(
      examples_lasso[seq_len(length(examples_lasso) - 2) + 1],
      collapse = "\n"
    )))

    testthat::expect_equal(result@cp_set, c(80, 200, 320))
  }
)

Try the fastcpd package in your browser

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

fastcpd documentation built on May 29, 2024, 8:36 a.m.