pretty_pvalues_compareGroups: pretty_pvalues() wrapper for compareGroups table

Description Usage Arguments Details Value Examples

Description

pretty_pvalues_compareGroups() takes a createTable object created from compareGroups::createTable(), and applies pretty_pvalues() to all p value columns.

Usage

1
2
3
4
pretty_pvalues_compareGroups(compareGroups_table_obj, digits = 3,
  include_p = FALSE, trailing_zeros = TRUE, output_type = NULL,
  bold = FALSE, italic = FALSE, background = NULL,
  sig_alpha = 0.05)

Arguments

compareGroups_table_obj

createTable object created from compareGroups::createTable() function, with at least one p value column

digits

number of digits to round to; values with zeros past this number of digits are truncated

include_p

TRUE or FALSE: set to TRUE to print "p = " before each p-value

trailing_zeros

TRUE or FALSE: default = TRUE, p-values are formatted with trailing zeros to the defined number of digits (i.e. 0.100 instead of 0.1 if digits= 3)

output_type

output type, either NULL (default), "latex", or "html" (making special charaters latex friendly)

bold

TRUE or FALSE: set to TRUE to bold p-values < the defined significance level

italic

TRUE or FALSE: set to TRUE to italicize p-values < the defined significance level

background

highlight color for p-values < the defined significance level. Default = NULL (no highlighting)

sig_alpha

the defined significance level. Default = 0.05

Details

This function is design specifically for input from compareGroups tables. Use pretty_pvalues directly when working with normal data.frames and other objects.

Value

createTable object with rounding, formating, and highlighting of any p value column.

Examples

1
2
3
4
5
6
7
8
data("Bladder_Cancer")
cycles_formula <- as.formula(Cycles_cat ~ Age_At_Diagnosis + Gender + Elix_Sum)
cycles_compare <- compareGroups::compareGroups(cycles_formula, data = Bladder_Cancer)
cycles_table <- compareGroups::createTable(cycles_compare, digits.p = 4, show.p.mul = TRUE)
cycles_table_fancy <- pretty_pvalues_compareGroups(cycles_table, background = 'yellow')

# Printing createTable object in report
compareGroups::export2latex(cycles_table_fancy, size = 'footnotesize', label = 'tab:Variable-of-Interest-Table', caption = 'Comparing Variables to Number of Cycles', header.labels = c('p.overall' = 'Overall P'), landscape = FALSE)

wfulp/MoffittFunctions documentation built on May 24, 2019, 11:44 p.m.