https://github.com/cran/bayestestR
Raw File
Tip revision: aee422d7cd4098dad89e31ecc6dfd9e539d2bda4 authored by Dominique Makowski on 06 August 2019, 10:20 UTC
version 0.2.5
Tip revision: aee422d
print.p_direction.R
#' @export
print.p_direction <- function(x, digits = 2, ...) {
  if ("data_plot" %in% class(x)) {
    print(as.data.frame(x))
  } else {
    insight::print_color("# Probability of Direction (pd)\n\n", "blue")

    if ("data.frame" %in% class(x)) {
      x$Parameter <- as.character(x$Parameter)
      x$pd <- sprintf("%.*f%%", digits, x$pd * 100)
      print.data.frame(x, row.names = FALSE)
    } else {
      cat(sprintf("pd = %.*f%%", digits, x * 100))
    }
  }
}
back to top