index.md (4531B)
1 --- 2 title: "R packages for table layout" 3 date: 2024-01-13T14:53:47-08:00 4 lastmod: 2024-01-23T19:42:44-08:00 5 draft: false 6 categories: 7 - Data Science 8 tags: 9 - R 10 --- 11 12 The R package ecosystem has several packages[^list] that were created to 13 help with the design and layout of tables in documents. 14 15 <!--more--> 16 17 - **condformat** ([Code forge](https://github.com/zeehio/condformat)) 18 - **DT** ([Code forge](https://github.com/rstudio/DT), [Website](https://rstudio.github.io/DT/)) 19 - **flextable** ([Code forge](https://github.com/davidgohel/flextable), [Website](https://davidgohel.github.io/flextable/)) 20 - **ftextra** ([Code forge](https://github.com/atusy/ftExtra), [Website](https://ftextra.atusy.net/)) 21 - **formattable** ([Code forge](https://github.com/renkun-ken/formattable), [Website](https://renkun-ken.github.io/formattable/)) 22 - **gt** ([Code forge](https://github.com/rstudio/gt/), [Website](https://gt.rstudio.com/)) 23 - **gtsummary** ([Code forge](https://github.com/ddsjoberg/gtsummary), [Website](https://www.danieldsjoberg.com/gtsummary/)) 24 - **gtExtras** ([Code forge](https://github.com/jthomasmock/gtExtras), [Website](https://jthomasmock.github.io/gtExtras/)) 25 - **pointblank** ([Code forge](https://github.com/rich-iannone/pointblank), [Website](https://rich-iannone.github.io/pointblank/)) 26 - **tfrmt** ([Code forge](https://github.com/GSK-Biostatistics/tfrmt), [Website](https://gsk-biostatistics.github.io/tfrmt/)) 27 - **gto** ([Code forge](https://github.com/GSK-Biostatistics/gto)) 28 - **huxtable** ([Code forge](https://github.com/hughjonesd/huxtable), [Website](https://hughjonesd.github.io/huxtable/)) 29 - **knitr** ([Code forge](https://github.com/yihui/knitr), [Website](https://yihui.org/knitr/)) 30 - **kableExtra** ([Code forge](https://github.com/haozhu233/kableExtra), [Website](https://haozhu233.github.io/kableExtra/)) 31 - **pander** ([Code forge](https://github.com/Rapporter/pander), [Website](http://rapporter.github.io/pander/)) 32 - **pixiedust** ([Code forge](https://github.com/nutterb/pixiedust)) 33 - **reactable** ([Code forge](https://github.com/glin/reactable), [Website](https://glin.github.io/reactable/)) 34 - **stargazer** ([CRAN](https://CRAN.R-project.org/package=stargazer)) 35 - **tablaxlsx** ([CRAN](https://cran.r-project.org/web/packages/tablaxlsx/index.html)) 36 - **tangram** ([Code forge](https://github.com/spgarbet/tangram)) 37 - **tinytable** ([Code forge](https://github.com/vincentarelbundock/tinytable/), [Website](https://vincentarelbundock.github.io/tinytable/)) 38 - **xtable** ([CRAN](https://CRAN.R-project.org/package=xtable), [Website](http://xtable.r-forge.r-project.org/)) 39 - **ztable** ([Code forge](https://github.com/cardiomoon/ztable)) 40 41 This list was mostly cribbed from an earlier version of the gt package’s 42 website. I found it to be a great resource and was disappointed when it was 43 removed[^removed], which is why I’ve posted it here. 44 45 Recently I had been programmatically formatting tables for 46 Excel[^xl][^paper] using [the openxlsx 47 package’s](https://cran.r-project.org/web/packages/openxlsx/) interface 48 directly, but this is rather low-level. After digging around a bit, I just 49 started using huxtable, and this week I developed a small R package that 50 extends it to simplify some repetitive tasks at my job. This may someday 51 mature enough for public release, but I can’t make any promises. 52 53 [^list]: This is almost certainly incomplete, and I would be happy to add 54 anything that’s either under active development or mature and stable. 55 56 [^removed]: Partially removed with [this 57 commit](https://github.com/rstudio/gt/commit/c01aad5c5734e8a0767328471342a1170554d1ec), 58 and mostly wiped away with [this 59 one](https://github.com/rstudio/gt/commit/4ef570e855dcf81532a78a38869f676a7a82b008). 60 To be clear, this sentiment was strictly “I’m disappointed because 61 I found this useful and now it’s gone”, and not, like, “I’m disappointed 62 _in_ Posit for removing it”. 63 64 [^xl]: My career has brought me into contact with a lot more people who want 65 summary results delivered in a spreadsheet than collaborators who prefer 66 a nice reproducible report---as much as I’d rather focus on the latter. 67 Reproducible spreadsheets, that is, spreadsheets that are created by 68 code, seem like the best compromise. 69 70 [^paper]: See also: Karl W. Broman & Kara H. Woo (2018) Data Organization in 71 Spreadsheets, The American Statistician, 72:1, 2-10, DOI: 72 [10.1080/00031305.2017.1375989](https://doi.org/10.1080/00031305.2017.1375989)