I want to report data in R using the display format like an MS Access block grouped report, that is, where the data that is duplicated on the subsequent lines of a group is omitted.
library(gt)
library(tidyverse)
df = tribble( ~a, ~b, ~c,
'a', 'b', 'c',
'a', 'b', 'd',
'a', 'b', 'e',
'1', 'b', 'c',
'1', 'b', 'd',
'1', 'b', 'e')
Desired output here (if you can imagine the red to be cut out)
I tried 2 different things. The plain gt() call comes close, but I want to get rid of the duplicated values, e.g. the values a/b in rows 2-3 and 1/b in rows 5-6.s
df %>% gt()
First, I grouped by 2 columns, but then I lost my column level formatting, and descriptive headers.
df %>%
group_by( a, b) %>%
gt()