Skip to content

Commit

Permalink
Merge branch 'fix_describe_posterior' of https://github.com/easystats…
Browse files Browse the repository at this point in the history
…/bayestestR into fix_describe_posterior
  • Loading branch information
DominiqueMakowski committed Sep 30, 2023
2 parents b89b3d9 + b30243b commit 4540746
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions R/p_map.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
#' for (iteration in 1:250) {
#' x <- rnorm(1000, 1, 1)
#' result <- data.frame(
#' "Kernel" = p_map(x, method = "kernel"),
#' "KernSmooth" = p_map(x, method = "KernSmooth"),
#' "logspline" = p_map(x, method = "logspline")
#' "Kernel" = as.numeric(p_map(x, method = "kernel")),
#' "KernSmooth" = as.numeric(p_map(x, method = "KernSmooth")),
#' "logspline" = as.numeric(p_map(x, method = "logspline"))
#' )
#' data <- rbind(data, result)
#' }
Expand Down
6 changes: 3 additions & 3 deletions man/p_map.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/test-ci.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test_that("ci", {
expect_equal(ci(distribution_normal(1000), ci = 0.90)$CI_low[1], -1.6361, tolerance = 0.02)
expect_equal(nrow(ci(distribution_normal(1000), ci = c(0.80, 0.90, 0.95))), 3, tolerance = 0.01)
expect_equal(ci(distribution_normal(1000), ci = 1)$CI_low[1], -3.29, tolerance = 0.02)
expect_equal(length(capture.output(print(ci(distribution_normal(1000), ci = c(.80, .90))))))
expect_length(capture.output(print(ci(distribution_normal(1000), ci = c(0.80, 0.90)))), 5)

expect_equal(ci(c(2, 3, NA))$CI_low, 2.02, tolerance = 1e-2)
expect_warning(ci(c(2, 3)))
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-format.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ test_that("p_significance", {
)
expect_equal(
format(map_estimate(x)),
data.frame(x = "0.13", stringsAsFactors = FALSE),
data.frame(MAP_Estimate = "0.13", stringsAsFactors = FALSE),
ignore_attr = TRUE
)
expect_equal(
format(p_direction(x)),
data.frame(x = "51.00%", stringsAsFactors = FALSE),
data.frame(Parameter = "Posterior", pd = "51.00%", stringsAsFactors = FALSE),
ignore_attr = TRUE
)
expect_equal(
format(p_map(x)),
data.frame(x = "0.973", stringsAsFactors = FALSE),
data.frame(Parameter = "Posterior", p_MAP = "0.973", stringsAsFactors = FALSE),
ignore_attr = TRUE
)
expect_equal(
format(p_significance(x)),
data.frame(x = "0.46", stringsAsFactors = FALSE),
data.frame(Parameter = "Posterior", ps = "0.46", stringsAsFactors = FALSE),
ignore_attr = TRUE
)
expect_equal(
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-p_significance.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_that("p_significance", {
expect_equal(as.numeric(ps), 0.816, tolerance = 0.1)
expect_s3_class(ps, "p_significance")
expect_s3_class(ps, "data.frame")
expect_identical(dim(ps), c(1L, 1L))
expect_identical(dim(ps), c(1L, 2L))
expect_identical(
capture.output(print(ps)),
c(
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-rope_range.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ test_that("rope_range", {
})

test_that("rope_range (multivariate)", {
skip_if_not_or_load_if_installed("brms")
model <- suppressWarnings(
brms::brm(brms::bf(mvbind(mpg, disp) ~ wt + gear) + brms::set_rescor(TRUE), data = mtcars, iter = 300)
)
Expand Down

0 comments on commit 4540746

Please sign in to comment.