The R package ecosystem has several packages1 that were created to help with the design and layout of tables in documents.
- condformat (Code forge)
- DT (Code forge, Website)
- flextable (Code forge, Website)
- ftextra (Code forge, Website)
- formattable (Code forge, Website)
- gt (Code forge, Website)
- gtsummary (Code forge, Website)
- gtExtras (Code forge, Website)
- pointblank (Code forge, Website)
- tfrmt (Code forge, Website)
- gto (Code forge)
- huxtable (Code forge, Website)
- knitr (Code forge, Website)
- kableExtra (Code forge, Website)
- pander (Code forge, Website)
- pixiedust (Code forge)
- reactable (Code forge, Website)
- stargazer (CRAN)
- tablaxlsx (CRAN)
- tangram (Code forge)
- tinytable (Code forge, Website)
- xtable (CRAN, Website)
- ztable (Code forge)
This list was mostly cribbed from an earlier version of the gt package’s website. I found it to be a great resource and was disappointed when it was removed2, which is why I’ve posted it here.
Recently I had been programmatically formatting tables for Excel34 using the openxlsx package’s interface directly, but this is rather low-level. After digging around a bit, I just started using huxtable, and this week I developed a small R package that extends it to simplify some repetitive tasks at my job. This may someday mature enough for public release, but I can’t make any promises.
-
This is almost certainly incomplete, and I would be happy to add anything that’s either under active development or mature and stable. ↩︎
-
Partially removed with this commit, and mostly wiped away with this one. To be clear, this sentiment was strictly “I’m disappointed because I found this useful and now it’s gone”, and not, like, “I’m disappointed in Posit for removing it”. ↩︎
-
My career has brought me into contact with a lot more people who want summary results delivered in a spreadsheet than collaborators who prefer a nice reproducible report—as much as I’d rather focus on the latter. Reproducible spreadsheets, that is, spreadsheets that are created by code, seem like the best compromise. ↩︎
-
See also: Karl W. Broman & Kara H. Woo (2018) Data Organization in Spreadsheets, The American Statistician, 72:1, 2-10, DOI: 10.1080/00031305.2017.1375989 ↩︎