https://github.com/cran/bayestestR
Revision aee422d7cd4098dad89e31ecc6dfd9e539d2bda4 authored by Dominique Makowski on 06 August 2019, 10:20:02 UTC, committed by cran-robot on 06 August 2019, 10:20:02 UTC
1 parent 23ea322
Raw File
Tip revision: aee422d7cd4098dad89e31ecc6dfd9e539d2bda4 authored by Dominique Makowski on 06 August 2019, 10:20:02 UTC
version 0.2.5
Tip revision: aee422d
print.p_rope.R
#' @export
print.p_rope <- function(x, digits = 2, ...) {
  if ("data_plot" %in% class(x)) {
    print(as.data.frame(x))
  } else {
    insight::print_color("# ROPE-based p-value\n\n", "blue")

    if ("data.frame" %in% class(x)) {
      pars <- format(x$Parameter)
      pmap <- format(sprintf("%.*f%%", digits, x$p_ROPE * 100), justify = "right")
      cat(paste0("  ", pars, ": ", pmap, collapse = "\n"))
    } else {
      cat(sprintf("p (ROPE) = %.*f%%", digits, x * 100))
    }
  }
}
back to top