xsummary: Summarize Chemical Differences

Description Usage Arguments Details Examples

View source: R/xsummary.R

Description

Make an HTML table summarizing chemical differences.

Usage

1
2
3
  xsummary(comptab, vars = c("ZC", "nH2O"))
  xsummary2(comptab1, comptab2)
  xsummary3(comptab1, comptab2, comptab3)

Arguments

comptab

list or data frame, summary of comparisons generated by get_comptab

vars

character, two variables to tabulate

comptab1

list, output of get_comptab

comptab2

list, output of get_comptab

comptab3

list, output of get_comptab

Details

xsummary makes an HTML table (using xtable) and adds bold and underline formatting to highlight significant chemical differences. The p-value is bolded if it is less than 0.05, and the percent common language effect size (CLES) is bolded if it is <= 40 or >= 60. The mean (or median) difference is [underlined / bolded] if [only one of / both] the p-value and CLES pass these cutoffs.

The generated table is written to the console, and can be used in a vignette using the results = "asis" chunk option. The function also returns (invisibly) the data frame used to make the table; this data frame differs from comptab by having row names added (alphabetical one-letter IDs for the datasets).

xsummary2 is an updated version that is used in the current vignettes in the package. It shows negative numbers in bold (p-value and CLES are not shown). xsummary3 is a further revision that shows GRAVY and pI; it is used in the osmotic_bact and osmotic_halo vignettes.

Examples

1
2
3
4
5
comptab <- lapply(c("JKMF10", "WDO+15_C.N"), function(dataset) {
  pdat <- pdat_colorectal(dataset)
  get_comptab(pdat, oldstyle = TRUE)
})
xsummary(comptab)

canprot documentation built on Jan. 17, 2022, 9:06 a.m.