https://github.com/cran/bayestestR
Raw File
Tip revision: 1b89ec86b6a914c4d45bee998d08eed1ef23f57f authored by Dominique Makowski on 20 July 2020, 08:30:03 UTC
version 0.7.2
Tip revision: 1b89ec8
test-brms.R
if (require("brms", quietly = TRUE)) {
  test_that("brms", {
    # testthat::skip_on_travis()
    testthat::skip_on_cran()

    set.seed(333)
    model <- insight::download_model("brms_mixed_1")

    testthat::expect_is(hdi(model), "data.frame")
    testthat::expect_is(ci(model), "data.frame")
    testthat::expect_is(rope(model), "data.frame")
    # testthat::expect_true("equivalence_test" %in% class(equivalence_test(model)))
    testthat::expect_is(map_estimate(model), "data.frame")
    testthat::expect_is(p_map(model), "data.frame")
    testthat::expect_is(mhdior(model), "data.frame")
    testthat::expect_is(p_direction(model), "data.frame")

    testthat::expect_equal(colnames(hdi(model)), c("Parameter", "CI", "CI_low", "CI_high", "Effects", "Component"))
    testthat::expect_equal(colnames(hdi(model, effects = "all")), c("Parameter", "CI", "CI_low", "CI_high", "Effects", "Component"))
    # testthat::expect_equal(nrow(equivalence_test(model)), 2)
  })
}
back to top