Closed john-b-edwards closed 2 years ago
I'm not able to replicate this issue. It appears something is going wrong at the pivot but I'm not sure why that would happen for one week and not the other and why there isn't a message in the console
https://github.com/sportsdataverse/cfbfastR/blob/main/R/cfbd_games.R#L1368-L1372
cfbfastR::cfbd_game_team_stats(2004, 2, "regular")
#> ── Team stats data from CollegeFootballData.com ────────────── cfbfastR 1.9.0 ──
#> ℹ Data updated: 2022-08-17 15:05:39 MST
#> # A tibble: 120 × 78
#> game_id school confe…¹ home_…² oppon…³ oppon…⁴ points total…⁵ net_p…⁶ compl…⁷
#> <int> <chr> <chr> <chr> <chr> <chr> <int> <chr> <chr> <chr>
#> 1 2.42e8 Duke ACC away Navy FBS In… 12 265 115 13-22
#> 2 2.42e8 Navy FBS In… home Duke ACC 27 430 134 8-9
#> 3 2.42e8 North… Mid-Am… away Maryla… ACC 20 337 228 19-37
#> 4 2.42e8 Maryl… ACC home Northe… Mid-Am… 23 367 198 12-22
#> 5 2.42e8 Willi… Atlant… away North … ACC 38 442 322 23-41
#> 6 2.42e8 North… ACC home Willia… Atlant… 49 575 236 14-24
#> 7 2.42e8 Clems… ACC home Wake F… ACC 37 371 297 20-41
#> 8 2.42e8 Wake … ACC away Clemson ACC 30 410 182 10-25
#> 9 2.42e8 Richm… Atlant… away NC Sta… ACC 0 167 51 10-27
#> 10 2.42e8 NC St… ACC home Richmo… Atlant… 42 403 237 24-32
#> # … with 110 more rows, 68 more variables: passing_tds <chr>,
#> # yards_per_pass <chr>, passes_intercepted <chr>, interception_yards <chr>,
#> # interception_tds <chr>, rushing_attempts <chr>, rushing_yards <chr>,
#> # rush_tds <chr>, yards_per_rush_attempt <chr>, first_downs <chr>,
#> # third_down_eff <chr>, fourth_down_eff <chr>, punt_returns <chr>,
#> # punt_return_yards <chr>, punt_return_tds <chr>, kick_return_yards <lgl>,
#> # kick_return_tds <lgl>, kick_returns <lgl>, kicking_points <chr>, …
#> # ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names
Odd, looks like it's been fixed internally? Either way, seems resolved.
Week 1 of 2022 has the same issue, reopening to investigate
When calling
cfbfastR::cfbd_game_team_stats()
, some season/week/season type combinations return long data, others return wide data.