gt tables

GT tables

In my job, I make tables all the time I recently stumbled upon the {gt} package and whoa… these are some great looking tables! You can check out the documentation here Even better, they are easy to append to any dplyr pipeline… Step 1: Load {gt} and {dplyr} library(gt) library(dplyr)  Step 2: Create a frequency table with mtcars, grouped by number of cylinders. Dplyr is quick and simple to use, but the console output is not so easy on the eyes… mtcars %>% group_by(cyl) %>% summarize(N = n()) %>% mutate(Frequency = N/sum(N), Frequency = round(Frequency, 2)) ## # A tibble: 3 x 3 ## cyl N Frequency ## <dbl> <int> <dbl> ## 1 4 11 0.