https://github.com/cran/bayestestR
Revision d8462ad2168ad7ee61c0d7e679174e775f01a9be authored by Dominique Makowski on 18 January 2020, 07:10 UTC, committed by cran-robot on 18 January 2020, 07:10 UTC
1 parent 4936034
Raw File
Tip revision: d8462ad2168ad7ee61c0d7e679174e775f01a9be authored by Dominique Makowski on 18 January 2020, 07:10 UTC
version 0.5.0
Tip revision: d8462ad
print.p_significance.R
#' @export
print.p_significance <- function(x, digits = 2, ...) {
  if ("data_plot" %in% class(x)) {
    print(as.data.frame(x))
  } else if ("data.frame" %in% class(x)) {
    .print_ps(x, digits, ...)
  } else {
    cat(sprintf(
      "ps [%s] = %s%%",
      insight::format_value(attributes(x)$threshold, digits = digits),
      insight::format_value(x * 100, digits = digits)
    ))
  }
}

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