https://github.com/cran/bayestestR
Revision 23ea3229abe72a5f23dcf3a4cfcd3478d744b536 authored by Dominique Makowski on 20 June 2019, 11:50:03 UTC, committed by cran-robot on 20 June 2019, 11:50:03 UTC
1 parent 9985109
Raw File
Tip revision: 23ea3229abe72a5f23dcf3a4cfcd3478d744b536 authored by Dominique Makowski on 20 June 2019, 11:50:03 UTC
version 0.2.2
Tip revision: 23ea322
print.p_map.R
#' @export
print.p_map <- function(x, digits = 3, ...) {
  if ("data_plot" %in% class(x)) {
    print(as.data.frame(x))
  } else {
    insight::print_color("# MAP-based p-value\n\n", "blue")

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