I would like to take a gt() table and transform it to a "wide" format instead of a "long" format by group level. So for, as an example using the iris data set:
library(dplyr)
library(gt)
iris %>%
group_by(Species) %>%
slice_max(Sepal.Length, n=5) %>%
group_by(Species) %>%
gt()
This produces:
However, what I want to produce is the following:
Is there a way to do this?