formatPval {biostatUZH} | R Documentation |
Formats p-values in a desired manner.
formatPval(x, break.eps = 1e-04, break.middle = 0.01, na.form = "NA", ...)
x |
a numeric vector. |
break.eps |
numeric value, see section details. |
break.middle |
numeric value, see section details. |
na.form |
character representation of |
... |
additional arguments passed to |
p-values < break.eps
are written as: "< break.eps"
.
p-values >= break.eps
but < break.middle
have 1 digit.
p-values >= break.middle
have 2 digits.
A vector of length(x)
with formatted p-values.
Sina Rueeger and Sebastian Meyer
the base function format.pval
,
format.pval
in package Hmisc,
formatPval
in package reporttools,
formatPval
in package surveillance
x <- c(1e-8, 0.00568, 0.0345, 0.885) biostatUZH::formatPval(x) # "< 0.0001" "0.006" "0.035" "0.89" ## compare to formatting of other packages if (requireNamespace("reporttools")) { reporttools::formatPval(x) # "< 0.0001" "0.0057" "0.03" "0.88" } if (requireNamespace("Hmisc")) { Hmisc::format.pval(x) # "0" "0.00568" "0.03450" "0.88500" } if (requireNamespace("surveillance")) { surveillance::formatPval(x) # "<0.0001" "0.0057" "0.035" "0.89" } ## adapt break.middle biostatUZH::formatPval(x, break.middle = 0.001)