Builds the markdown per-category \(\lambda_{\mathrm{GC}}\) table (the common-support view) that the coding diagnostics and compare reports render from lambda_by_category.csv. The shared core (filter to common support, fixed method-column order, category rows sorted with ALL appended last, the negative-control tag) is factored here and the per-report differences are parameterised by show_n / append_all_row / extra_note.

build_lambda_table_md(
  lam,
  methods,
  neg_control = "synonymous",
  support = "common_ge2",
  show_n = FALSE,
  append_all_row = TRUE,
  extra_note = NULL
)

Arguments

lam

data.frame read from lambda_by_category.csv. Required columns: category, method, support, n, lambda_gc. Must be non-NULL.

methods

Character vector of method columns, in display order. Only those also present in the common-support rows of lam are shown (intersect, preserving this order).

neg_control

Category name tagged with the negative-control marker. Default "synonymous".

support

Value of lam$support selecting the common-support rows. Default "common_ge2".

show_n

Logical. If TRUE, cells read "X.XXX (n=NN)" and missing lambdas read "NA (n=NN)"; if FALSE (default), cells read "X.XXX" / "NA".

append_all_row

Logical. If TRUE (default), an "ALL" row is appended after the sorted non-ALL categories.

extra_note

Optional character vector of trailing note line(s) appended after a blank line below the table. NULL (default) appends no note.

Value

Character vector of markdown lines (header, separator, one line per category, then a blank line and the extra_note lines when extra_note is non-NULL).

Details

Returns the table block from the header row through the trailing note(s): the caller still emits the section header, leading blank line, the lam-is-NULL else-branch, and the trailing blank line, so the surrounding structure of each report is unchanged.