fmt_p_value_md: Format a _p_-value in markdown

View source: R/formatters.R

fmt_p_value_mdR Documentation

Format a p-value in markdown

Description

Format a p-value in markdown

Usage

fmt_p_value_md(ps)

Arguments

ps

p-values to format

Details

fmt_p_value() is for formatting p-values with manual precision, but this functions follows some reasonable defaults and returns a markdown formatted string.

Values less than .06 are formatted with 3 digits. Values equal to .06 or greater are formatted with 2 digits.

scales::label_pvalue() does the initial rounding and formatting. Then this function strips off the leading 0 of the p value.

Value

a character vector of markdown formatted p-values

Examples

fmt_p_value_md(0.0912)
fmt_p_value_md(0.0512)
fmt_p_value_md(0.005)

# "p less than" notation kicks in below .001.
fmt_p_value_md(0.0005)

tjmahr/printy documentation built on March 4, 2024, 1:25 a.m.