diff --git a/NAMESPACE b/NAMESPACE index 41ee4b250..851bbaedb 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -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) diff --git a/R/format.R b/R/format.R index 092bfef95..40515535a 100644 --- a/R/format.R +++ b/R/format.R @@ -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 diff --git a/tests/testthat/test-format.R b/tests/testthat/test-format.R index 4ee2f43d7..27f934b36 100644 --- a/tests/testthat/test-format.R +++ b/tests/testthat/test-format.R @@ -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 + ) })