formatOR: A handy function for formatting ORs (Odds Ratios) to...

View source: R/formatting.R

formatORR Documentation

A handy function for formatting ORs (Odds Ratios) to publication-ready format

Description

Especially handy when some other function has problems with displaying Inf

Usage

formatOR(OR, inf.as = "Inf", sig.digs = 3)

Arguments

OR

A single number with OR to be formatted, can be +Inf.

inf.as

A string, defining how +Inf should be displayed as, 'Inf' by default.

sig.digs

A number of significant digits to show. By default 3.

Details

TODO: Allow vectorized input TODO: Add a way to include Confidence Intervals

Value

A character vector with OR formatted in a nice way

See Also

Other publishing-formatting: formatP(), signif_sym()

Examples

formatOR(0.0026485635335) # -> "0.00265"
formatOR(Inf) # -> "Inf"

JantekM/JantoTools documentation built on Jan. 31, 2023, 1:28 p.m.