format_stat: Manuscript-friendly number formatting

Description Usage Arguments Examples

Description

Formats a numeric result (e.g., p-value) as a manuscript-friendly string in which values below a minimum cutoff (e.g., 10^-5) are reported for example as "< 10^-5", values between the minimum cutoff and a maximum cutoff (e.g., 0.01) are reported in scientific notation, and p-values above the maximum cutoff are reported simply as, for example, 0.72.

Usage

1
format_stat(x, digits = 2, cutoffs = c(0.01, 10^-5))

Arguments

x

Numeric value to format

digits

Digits for rounding

cutoffs

A vector containing the two cutoffs

Examples

1
2
3
4
5
format_stat(0.735253)
format_stat(0.735253, digits = 4)
format_stat(0.0123)
format_stat(0.0001626)
format_stat(0.0001626, cutoffs = c(0.01, 10^-3))

MetaUtility documentation built on Oct. 30, 2021, 5:07 p.m.