https://github.com/cran/bayestestR
Raw File
Tip revision: 6acd4f1707b182a2cbe2f4a4c2d4196571d36eb3 authored by Dominique Makowski on 05 December 2020, 08:30:02 UTC
version 0.8.0
Tip revision: 6acd4f1
print.p_direction.R
#' @export
print.p_direction <- function(x, digits = 2, ...) {
  orig_x <- x
  if ("data_plot" %in% class(x)) {
    print(as.data.frame(x))
  } else if ("data.frame" %in% class(x)) {
    .print_pd(x, digits, ...)
  } else {
    cat(sprintf("pd = %s%%", insight::format_value(x * 100, digits = digits)))
  }
  invisible(orig_x)
}

#' @keywords internal
.print_pd <- function(x, digits, ...) {
  insight::print_color("# Probability of Direction (pd)\n\n", "blue")
  x$Parameter <- as.character(x$Parameter)
  x$pd <- sprintf("%s%%", insight::format_value(x$pd * 100, digits = digits))
  print_data_frame(x, digits = digits)
}
back to top