Skip to content

Commit

Permalink
Prepare CRAN release
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jan 31, 2025
1 parent d8edd37 commit 1683ef4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
26 changes: 12 additions & 14 deletions tests/testthat/test-rope.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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))

Check warning on line 121 in tests/testthat/test-rope.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-rope.R,line=121,col=121,[line_length_linter] Lines should not be more than 120 characters. This line is 124 characters.
rope <- rope(model, verbose = FALSE)

Expand All @@ -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)
})

0 comments on commit 1683ef4

Please sign in to comment.