tests/testthat/test-bind-dimensions.R

test_that("bind_dimensions", {
  expect_identical(pdims(bind_dimensions(mcmcr_example$beta, mcmcr_example$beta)), c(2L, 2L, 2L))
  expect_identical(
    pdims(bind_dimensions(mcmcr_example, mcmcr_example)),
    list(alpha = c(2L, 2L), beta = c(2L, 2L, 2L), sigma = c(1L, 2L))
  )

  expect_identical(
    pdims(bind_dimensions(mcmcr_example, mcmcr_example, along = 1L)),
    list(alpha = c(4L), beta = c(4L, 2L), sigma = c(2L))
  )

  expect_identical(
    pdims(bind_dimensions(mcmcr_example2, mcmcr_example2)),
    list(alpha = c(2L, 1L, 1L, 2L), beta = c(2L, 2L, 2L, 2L), sigma = c(1L, 1L, 1L, 2L))
  )
})

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.