Can gt collapse rows like kableExtra::collapse_rows?

I like the gt package with its many functionalities, but I can't find a way to collapse rows like it is possible to do in the kableExtra package.

Is is possible to the below, but using gt?

library(tidyverse)
library(kableExtra)

table <- tibble(
  X = c("A", "A", "A", "A", "B", "B", "B", "B"),
  Y = c("C", "C", "D", "D", "E", "E", "F", "F"),
  z = rnorm(8))

table %>% 
  kable() %>% 
  kable_styling() %>% 
  collapse_rows(columns = c(1, 2))

image

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.