This guide covers generating publication-ready tables programmatically - descriptive Table 1, regression and differential-expression result tables, and supplementary tables. The decisions that matter are choosing the right statistics (descriptive vs inferential, and never a baseline p-value on a randomized Table 1), exporting to the journal's actual target format (Word fidelity is the chronic pain point), and protecting gene symbols from Excel auto-conversion. A table, like a figure, is a deterministic function of data and code - generate it, never hand-edit it.
# R
install.packages(c('gtsummary', 'gt', 'flextable', 'kableExtra', 'tableone'))
# Python
pip install great_tables pandas tableone openpyxl
Tell your AI agent what you want to do: - "Make a Table 1 of baseline characteristics by treatment arm" - "Export my DESeq2 results as a formatted Word table" - "Build a regression table with odds ratios and 95% CIs" - "Write a supplementary gene table to Excel without SEPT9 turning into a date" - "Use SMD instead of p-values to show baseline balance"
"Create a Table 1 by arm with median (IQR) for continuous variables and show missing counts"
"Add standardized mean differences instead of a p-value column to my baseline table"
"Turn my logistic regression into a table of odds ratios with confidence intervals"
"Merge the univariable and multivariable regression results side by side"
"Export this gtsummary table to Word with the formatting intact"
"Write my full DE results as a gene-symbol-safe CSV and Excel supplement"
missing="ifany"); never compute percentages that silently hide dropped rows.save_as_docx() is the most reliable Word path; great_tables cannot export Word or LaTeX.'@'; verify by reopening.