Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jun 29, 2023
1 parent 3a72b4c commit 902bd0a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,14 @@ S3method(format,bayestestR_eti)
S3method(format,bayestestR_hdi)
S3method(format,bayestestR_si)
S3method(format,describe_posterior)
S3method(format,equivalence_test)
S3method(format,map_estimate)
S3method(format,p_direction)
S3method(format,p_map)
S3method(format,p_rope)
S3method(format,p_significance)
S3method(format,point_estimate)
S3method(format,rope)
S3method(hdi,BFBayesFactor)
S3method(hdi,BGGM)
S3method(hdi,MCMCglmm)
Expand Down
5 changes: 5 additions & 0 deletions R/format.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ format.bayestestR_eti <- format.describe_posterior
#' @export
format.bayestestR_si <- format.describe_posterior

#' @export
format.equivalence_test <- format.describe_posterior

#' @export
format.rope <- format.describe_posterior



Expand Down
16 changes: 14 additions & 2 deletions tests/testthat/test-format.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ test_that("p_significance", {
data.frame(x = "0.46", stringsAsFactors = FALSE),
ignore_attr = TRUE
)
# format(rope(x))
# format(equivalence_test(x))
expect_equal(
format(rope(x)),
data.frame(CI = "0.95", ROPE = "[-0.10, 0.10]", `% in ROPE` = "10.64%", stringsAsFactors = FALSE),
ignore_attr = TRUE
)
expect_equal(
format(equivalence_test(x)),
data.frame(
CI = "0.95", ROPE = "[-0.10, 0.10]", `% in ROPE` = "10.64%",
`Equivalence (ROPE)` = "Undecided", HDI_low = "-1.93", HDI_high = "1.77",
stringsAsFactors = FALSE
),
ignore_attr = TRUE
)
})

0 comments on commit 902bd0a

Please sign in to comment.