From 1683ef478cea230512bb7b5d4be6325f2b7f0313 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 31 Jan 2025 18:01:34 +0100 Subject: [PATCH] Prepare CRAN release --- DESCRIPTION | 2 +- tests/testthat/test-rope.R | 26 ++++++++++++-------------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5796f5601..e00a19242 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: bayestestR Title: Understand and Describe Bayesian Models and Posterior Distributions -Version: 0.15.1.2 +Version: 0.15.2 Authors@R: c(person(given = "Dominique", family = "Makowski", diff --git a/tests/testthat/test-rope.R b/tests/testthat/test-rope.R index a4124dc6e..a4b399e5f 100644 --- a/tests/testthat/test-rope.R +++ b/tests/testthat/test-rope.R @@ -94,8 +94,19 @@ test_that("rope", { }) +test_that("BayesFactor", { + skip_on_os(c("linux", "mac")) + skip_if_not_or_load_if_installed("BayesFactor") + + mods <- regressionBF(mpg ~ am + cyl, mtcars, progress = FALSE) + rx <- suppressMessages(rope(mods, verbose = FALSE)) + expect_equal(rx$ROPE_high, -rx$ROPE_low, tolerance = 0.01) + expect_equal(rx$ROPE_high[1], 0.6026948, tolerance = 0.01) +}) + + skip_if_not_or_load_if_installed("brms") -skip_on_os("windows") +skip_on_os(c("windows", "mac")) set.seed(123) model <- suppressWarnings(brms::brm(mpg ~ wt + gear, data = mtcars, iter = 500)) @@ -107,8 +118,6 @@ test_that("rope (brms)", { expect_equal(rope$ROPE_Percentage, c(0.00, 0.00, 0.50), tolerance = 0.1) }) -skip_on_os("mac") - model <- suppressWarnings(brm(bf(mvbind(mpg, disp) ~ wt + gear) + set_rescor(TRUE), data = mtcars, iter = 500, refresh = 0)) rope <- rope(model, verbose = FALSE) @@ -122,14 +131,3 @@ test_that("rope (brms, multivariate)", { tolerance = 0.1 ) }) - -skip_on_os("linux") - -test_that("BayesFactor", { - skip_if_not_or_load_if_installed("BayesFactor") - - mods <- regressionBF(mpg ~ am + cyl, mtcars, progress = FALSE) - rx <- suppressMessages(rope(mods, verbose = FALSE)) - expect_equal(rx$ROPE_high, -rx$ROPE_low, tolerance = 0.01) - expect_equal(rx$ROPE_high[1], 0.6026948, tolerance = 0.01) -})