Description Usage Arguments Details Value Examples
pretty_pvalues_compareGroups() takes a createTable object created from compareGroups::createTable(), and applies pretty_pvalues() to all p value columns.
1 2 3 4 |
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 |
This function is design specifically for input from compareGroups tables. Use pretty_pvalues
directly when working with normal data.frames and other objects.
createTable object with rounding, formating, and highlighting of any p value column.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.