I'd like to share ksTFL, an R package my colleague and I created for generating clinical Tables, Figures, and Listings as DOCX. It came out of our day jobs in clinical statistical programming, where the analysis in R is solid but the report at the end still has to land in Word, in a format sponsors and regulators expect.
The idea: you describe the table (title, footnotes, column headers, indentation, borders) as metadata, pass it together with your data, and ksTFL renders it into MS Word DOCX with proper styles and pagination that doesn't shift when you rebuild.
It can also assemble many tables, figures and listings into one document with a multilevel table of contents, headers and footers included.
One thing to be clear about: ksTFL does not calculate anything for you like many clinical reporting packages tents to do. You do the stats, it renders what you calculated into DOCX in a predictable way - that's the whole job, and it does it very well ![]()
Docs and examples: https://crow16384.github.io/ksTFL/
GitHub: https://github.com/crow16384/ksTFL
Install:
install.packages("ksTFL", repos = "https://crow16384.r-universe.dev")
