tests/testthat/test-data-raw.R

test_that("data-raw", {
  data(line, package = "coda")

  mcmcr <- as.mcmcr(line)

  expect_equal(as.mcmc.list(mcmcr), line, ignore_attr = TRUE)

  mcmcr$alpha <- bind_dimensions(mcmcr$alpha, mcmcr$alpha + 1)

  mcmcr$beta <- bind_dimensions(mcmcr$beta, mcmcr$beta + 1)
  mcmcr$beta <- bind_dimensions(mcmcr$beta, mcmcr$beta + 1, along = 1L)

  expect_identical(pars(mcmcr), c("alpha", "beta", "sigma"))
  expect_identical(nchains(mcmcr), 2L)
  expect_identical(niters(mcmcr), 200L)
  expect_identical(nterms(mcmcr), 7L)
})

Try the mcmcr package in your browser

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

mcmcr documentation built on Sept. 7, 2021, 1:07 a.m.