format_pval {clinpubr} | R Documentation |
Format p-value for publication
Description
Format p-value with modified default settings suitable for publication.
Usage
format_pval(
p,
text_ahead = NULL,
digits = 1,
nsmall = 2,
eps = 0.001,
na_empty = TRUE
)
Arguments
p |
The numerical p values to be formatted. |
text_ahead |
A string to be added before the p value. If not |
digits |
The number of digits to be used. Same as in |
nsmall |
The number of digits after the decimal point. Same as in |
eps |
The threshold for rounding p values to 0. Same as in |
na_empty |
If |
Value
A string vector of formatted p values.
Examples
format_pval(c(0.001, 0.0001, 0.05, 0.1123456))
format_pval(c(0.001, 0.0001, 0.05, 0.1123456), text_ahead = "p value")
[Package clinpubr version 1.0.1 Index]