powered by
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.
0.01
.01
print_zero
nice_p(p_val, print_zero = FALSE)
A character vector with the formatted p-value(s)
A numeric. The p-value to format.
A logical. Should leading zero be printed? (see Details)
pvals <- c(0.056548, 0.0002654, 0.816546, 0.0493321) nice_p(pvals) nice_p(pvals, print_zero = TRUE)
Run the code above in your browser using DataLab