Closed brett250000 closed 2 years ago
Thanks for heads up! Please install latest dev version for fix - that function is now using gtExtras::gt_index()
internally which is group-safe.
library(gt)
library(gtExtras)
team_df <- readRDS(url("https://github.com/nflverse/nflfastR-data/raw/master/teams_colors_logos.rds"))
set.seed(36)
team_df %>%
dplyr::slice_sample(n = 12) %>%
dplyr::select(team_nick, team_abbr, team_conf, team_division, team_logo_wikipedia, team_wordmark) %>%
gt(groupname_col = "team_conf") %>%
gt_merge_stack(col1 = team_nick, col2 = team_division) %>%
gt_img_rows(team_logo_wikipedia) %>%
gt_img_rows(team_wordmark)
Created on 2022-06-16 by the reprex package (v2.0.1)
It appears that the gt_merge_stack function is not working correctly if you are grouping first by another field. I was just looking at the example with NFL teams and noticed that the Ravens are not in the NFC West.
Worth noting that if you don't group by conference, the gt_merge_stack field displays correctly.