p_values: Round p-value

p_valuesR Documentation

Round p-value

Description

Rounds a p-value by decimal places and reports with sig figs

Usage

p_round(x, n = 3, sig = n)

p_value_sig(x, cutoffs = c(`***` = 0.001, `**` = 0.01, `*` = 0.05, . = 0.1))

Arguments

x

A vector of p-values

n

Number of digits to round by (if NULL - no rounding occurs)

sig

Number of significant figures (if NULL - not used)

cutoffs

A named vector for significant cutoffs

Examples

set.seed(42)
x <- stats::pchisq(abs(runif(25)), 4)
print(data.frame(x = x,
                 p = p_round(x),
                 sigs = p_value_sig(x)),
      digits = 3,
      right = FALSE)

jmbarbone/jordanExtra documentation built on Sept. 5, 2024, 12:33 p.m.