Following conventions of many medical journals, this function rounds a p-value to two digits (if p > 0.05) or three digits (if 0.001 <= p < 0.05), or returns an inequality of "< 0.001" (if p < 0.001).
roundp(pee, equal = FALSE)
Numeric p-vale
Show equal sign if p > 0.001? Defaults to FALSE
String: rounded number, preceded by equal sign (unless equal = FALSE
)
or less-than sign.
roundp(0.1138)
#> [1] "0.11"
roundp(c(0.01138, 0.0000138))
#> [1] "0.011" "< 0.001"
# Include equal sign
roundp(0.01138, equal = TRUE)
#> [1] "= 0.011"