R/utils_general.R

Defines functions .pvalformat

#' Internal function to format pvalues.
#' @param x Input p-value. Numeric value.
#' @noRd
.pvalformat <- function(x) {
  if (x < 0.001) {
    "<0.001"
  } else if (x > 0.999) {
    ">0.999"
  } else {
    format(round(x, 3),
      nsmall = 3,
      justify = "right",
      width = 6,
      scientific = FALSE
    )
  }
}

Try the visR package in your browser

Any scripts or data that you put into this service are public.

visR documentation built on Nov. 21, 2023, 1:07 a.m.