library(gt) # Sample data frame data <- data.frame( Name = c("Alice", "Bob", "Charlie"), Age = c(25, 30, 22), Score = c(95, 88, 73) ) # Create a gt table with a summary row table <- data %>% gt() %>% summary_row( fns = list( Age = "total", Score = "total" ), columns = c(Age, Score) ) # Print the table table