Takes a p value and formats it to three decimal places for printing.

nice_pval(x)

Arguments

x

A p-value

Value

A string where the p-value is formatted to three decimal places or "<0.001" where appropriate

Examples

nice_pval(0.045)
#> [1] "0.045"
nice_pval(1e-05)
#> [1] "< 0.001"