library(gt) # Sample data frame df <- data.frame(ID = c(1, 2, 3, 4, 5), Name = c("John", "Jane", "Alice", "Bob", "Eve"), Age = c(25, 30, 35, 40, 45)) # Create a gt table tab <- df %>% gt() # Apply filter on the grouped table filtered_tab <- tab %>% tab_row_group(label = "dd") %>% filter(Name == "Alice" & Age > 30) # Print the filtered table print(filtered_tab)