to_lessthan: Function for converting p values to '< 0.01' (or desired...

Description Usage Arguments Value Examples

Description

This function is best used for transforming numeric pvalue columns into character representation based on desired number of sig figs. Defaults to replacing numeric vectors below 0.01 with '<0.01'

Usage

1
to_lessthan(x, digits = 2)

Arguments

x

Numeric vector

digits

desired number of digits to round to

Value

character vector with values below rounding limit coerced to '< x'

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(mtcars)

Remove Toyota corona (row 21) to get larger smaller pvalue for illustration
mod = glm(am ~  hp + wt ,
          data = mtcars[-21,], family = binomial())

tab = glm_ORs(mod)

tab$p_1d = to_lessthan(tab$p, digits = 1)
tab$p_2d = to_lessthan(tab$p, digits = 2)

tab

Ajfrick/AVRCHelp documentation built on May 28, 2019, 1:34 a.m.