fmt_pvalue: Formats p-values to be displayed in tables or text of report.

Description Usage Arguments Value Examples

Description

Formats p-values to be displayed in tables or text of report.

Usage

1
fmt_pvalue(x, digits = 1, prepend_p = FALSE)

Arguments

x

numeric vector of p-values.

digits

number of digits large p-values are rounded. Must be 1 or 2. Default is 1.

prepend_p

logical. Should 'p=' be prepended to formatted p-value. Default is FALSE

Value

Formatted p-values

Examples

1
2
3
4
5
6
pvals <- c(
  1.5, 1, 0.999, 0.5, 0.25, 0.2, 0.197, 0.12, 0.10, 0.0999, 0.06,
  0.03, 0.002, 0.001, 0.00099, 0.0002, 0.00002, -1
)
fmt_pvalue(pvals)
fmt_pvalue(pvals, digits = 2, prepend_p = TRUE)

ddsjoberg/gtsummary-v0.1 documentation built on June 4, 2019, 7:48 a.m.