Skip to contents

This function binds a named list of domain-specific tables, or handles a single data frame. It optionally sorts by the raw E_Val_bound column, renames columns, highlights rows above a threshold, and groups rows by domain when provided. 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.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", align = NULL)
)

Arguments

tables_list

a named list of data frames, each a domain table, or a single data frame. For lists, row names are captured as an "Outcome" column; for data frames, same applies.

sort_E_val_bound

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

e_val_bound_threshold

numeric; threshold for highlighting rows. default 1.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 "markdown".

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(). default list(booktabs=TRUE, caption="Combined Results", align=NULL).