# \donttest{
library(gt)
library(nflplotR)
teams <- valid_team_names()
# remove conference logos from this example
teams <- teams[!teams %in% c("AFC", "NFC", "NFL")]
# create dataframe with all 32 team names
df <- data.frame(
team_a = head(teams, 16),
logo_a = head(teams, 16),
wordmark_a = head(teams, 16),
team_b = tail(teams, 16),
logo_b = tail(teams, 16),
wordmark_b = tail(teams, 16)
)
# create gt table and translate team names to logo/wordmark images
table <- df |>
gt() |>
gt_nfl_logos(columns = gt::starts_with("logo")) |>
gt_nfl_wordmarks(columns = gt::starts_with("wordmark"))
# }
Run the code above in your browser using DataLab