Skip to contents

Format p-values nicely

Usage

formatP(p, digits = 2, label = FALSE)

Arguments

p

Vector of p-values to format

digits

Digits after decimal point to display

label

If label=TRUE, prints p=0.01; otherwise, just returns 0.01

Examples

formatP(0.000003434)
#> [1] "< 0.0001"
formatP(0.12)
#> [1] "0.12"
formatP(0.12, label=TRUE)
#> [1] "p = 0.12"