nice_p: Nice printing of p-values

View source: R/nice_p.R

nice_pR Documentation

Nice printing of p-values

Description

[Stable] Formatting function for consistent p-value reporting.

You can choose to print the leading zero (e.g. 0.01) or not (e.g. .01) with print_zero.

Usage

nice_p(p_val, print_zero = FALSE)

Arguments

p_val

A numeric. The p-value to format.

print_zero

A logical. Should leading zero be printed? (see Details)

Value

A character vector with the formatted p-value(s)

Examples

pvals <-
  c(0.056548, 0.0002654, 0.816546, 0.0493321)
nice_p(pvals)

nice_p(pvals, print_zero = TRUE)

vigicaen documentation built on April 3, 2025, 8:55 p.m.