Get Season Statistics by Player
source("https://raw.githubusercontent.com/sportsdataverse/cfbfastR-data/main/themes/gt_theme_code_SG.R")
passing_df <- dplyr::bind_rows(
cfbd_stats_season_player(2019, team = "LSU", category = "passing"),
cfbd_stats_season_player(2013, team = "Florida State", category = "passing")) %>%
dplyr::left_join(logos, by=c("team"="school")) %>%
dplyr::group_by(team) %>%
dplyr::select(logo,
player,
passing_completions,
passing_att,
passing_yds,
passing_td,
passing_int,
passing_ypa) %>%
arrange( desc(passing_yds), team)
## Adding missing grouping variables: `team`
passing_df %>% gt() %>%
tab_header(title = "Passing Summary") %>%
cols_label(logo="",
player = "Player",
passing_completions = "C",
passing_att = "Att",
passing_yds = "Yds",
passing_td = "TDs",
passing_int = "INTs",
passing_ypa = "YPA") %>%
data_color(
columns = c("passing_yds"),
colors = scales::col_numeric(
palette = "RdBu",
domain = c(-6000,6000)
)
) %>%
data_color(
columns = c("passing_td"),
colors = scales::col_numeric(
palette = "RdBu",
domain = c(-60,60)
)
) %>%
data_color(
columns = c("passing_td"),
colors = scales::col_numeric(
palette = "RdBu",
domain = c(-60,60)
)
) %>%
text_transform(
locations = cells_body(c("logo")),
fn = function(logo){
web_image(url= logo)
}) %>%
tab_source_note(source_note = md("**Table:** @SaiemGilani | **Data:** @CFB_Data with @cfbfastR v1.1.0")) %>%
gt_theme_538(table.width = px(550))
## Warning: Since gt v0.9.0, the `colors` argument has been deprecated.
## • Please use the `fn` argument instead.
## This warning is displayed once every 8 hours.
Passing Summary |
|
Player |
C |
Att |
Yds |
TDs |
INTs |
YPA |
LSU |
 |
Joe Burrow |
402 |
527 |
5671 |
60 |
6 |
10.8 |
 |
Myles Brennan |
24 |
40 |
353 |
1 |
1 |
8.8 |
Florida State |
 |
Jameis Winston |
257 |
384 |
4057 |
40 |
10 |
10.6 |
 |
Jake Coker |
18 |
36 |
250 |
0 |
1 |
6.9 |
 |
Sean Maguire |
13 |
21 |
116 |
2 |
2 |
5.5 |
Table: @SaiemGilani | Data: @CFB_Data with @cfbfastR v1.1.0 |
## ── Stat categories for CollegeFootballData.com ─────────────── cfbfastR 2.0.0 ──
## ℹ Data updated: 2025-08-25 19:44:16 UTC
## # A tibble: 38 × 1
## category
## <chr>
## 1 completionAttempts
## 2 defensiveTDs
## 3 extraPoints
## 4 fieldGoalPct
## 5 fieldGoals
## 6 firstDowns
## 7 fourthDownEff
## 8 fumblesLost
## 9 fumblesRecovered
## 10 interceptions
## # ℹ 28 more rows