format_p.Rd
Formats p-values as strings with specified precision and optional significance asterisks.
format_p(p, digit = 3, asterisk = FALSE)
A numeric p-value between 0 and 1.
A numeric determine decimal. Accepts:
3
:convert to 3 decimal, default
4
:convert to 4 decimal
Logical indicating whether to return significance asterisks.
Character of formatted p-value or asterisks.
format_p(0.00009, 4)
#> [1] "<0.0001"
format_p(0.03, 3)
#> [1] "0.030"
format_p(0.02, asterisk = TRUE)
#> [1] "*"