gtsummary
Overview
{gtsummary}
has become my preferred way of creating tables of all types. It’s highly customizable and can almost always get the exact output I’m looking for. It’s based of the {gt}
package for creating tables, so can be even more customizable. It also includes functions for pulling out numbers from the tables to report in the text.
Slides
Open the slides in a new tab here.
Exercises
- Download the quarto document here and put it into your R project folder.
- Render the document.
- Make a
tbl_summary()
. Include (at least) number of hours of sleep on weekdays and weekends, categorical region, and income and make sure they are nicely labeled. Play around with the extra functions from the examples and/or from the documentation - Fit a Poisson regression for the number of siblings, using at least 3 predictors of your choice. Create a nice table displaying your Poisson regression and its exponentiated coefficients.
Resources
{gtsummary}
documentation{gt}
documentation{flextable}
documentation{gtExtras}
documentation- Discussion here and here about table rendering issues that will be fixed in the next quarto update.