Skip to contents

This function binds a named list of domain-specific tables, optionally sorts by the raw E_Val_bound column (ascending or descending), optionally renames columns, highlights rows above a threshold, and groups rows by domain. works for latex, html, or markdown output.

Usage

margot_bind_tables(
  tables_list,
  sort_E_val_bound = c("none", "asc", "desc"),
  e_val_bound_threshold = 1,
  highlight_color = "yellow",
  bold = TRUE,
  output_format = "markdown",
  rename_cols = TRUE,
  col_renames = list(`E-Value` = "E_Value", `E-Value bound` = "E_Val_bound"),
  rename_ate = FALSE,
  threshold_col = "E_Val_bound",
  kbl_args = list(booktabs = TRUE, caption = "Combined Results by Domain", align = NULL)
)

Arguments

tables_list

a named list of data frames; each element is a domain table. row-names are captured as an "Outcome" column.

sort_E_val_bound

character: one of "none", "asc", or "desc". default "none".

e_val_bound_threshold

numeric; threshold for highlighting rows. default 1.

highlight_color

character or NULL; background colour for highlighted rows. default "yellow".

bold

logical; whether to bold highlighted rows. default TRUE.

output_format

character; one of "latex", "html", or "markdown". default "latex".

rename_cols

logical; whether to apply column renaming. default TRUE.

col_renames

named list; mapping new_name = old_name for renaming. default list("E-Value"="E_Value","E-Value bound"="E_Val_bound").

rename_ate

logical; if TRUE, renames the effect column to "ATE". default FALSE.

threshold_col

character; name of the (pre-rename) column to test. default "E_Val_bound".

kbl_args

list; extra arguments for kableExtra::kbl(), e.g. list(booktabs=TRUE, caption="Combined Results by Domain", align=NULL).