tests/testthat/test-coef_hist.R

test_that(paste("coef_hist creates correct lists with graphs"), {

  data_prepared <- bdsm::economic_growth[,1:6] %>%
    bdsm::feature_standardization(
      excluded_cols = c(country, year, gdp)
    ) %>%
    bdsm::feature_standardization(
      group_by_col  = year,
      excluded_cols = country,
      scale         = FALSE
    )

  bma_results <- bma(small_model_space, df = data_prepared, round= 3, dilution = 0)

  coef_plots <- coef_hist(bma_results, kernel = 1)

  expect_equal(class(coef_plots), "list")
  expect_true(ggplot2::is_ggplot(coef_plots[[1]]))
  expect_true(ggplot2::is_ggplot(coef_plots[[2]]))
  expect_true(ggplot2::is_ggplot(coef_plots[[3]]))
  expect_true(ggplot2::is_ggplot(coef_plots[[4]]))
})

Try the bdsm package in your browser

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

bdsm documentation built on Sept. 9, 2025, 5:55 p.m.