sportsdataverse / cfbfastR

An R package to quickly obtain clean and tidy college football play by play data
https://cfbfastR.sportsdataverse.org
Other
74 stars 8 forks source link

R: cfbd_game_player_stats giving 400 error #79

Closed rcpiv closed 2 years ago

rcpiv commented 2 years ago

Describe the bug cfbd_game_player_stats giving 400 error. No other cfbd function is throwing said error.

To Reproduce Steps to reproduce the behavior: In R install.packages('cfbfastR') library(cfbfastR) cfbd_game_player_stats(2021)

Expected behavior Expect to load a dataframe.

Screenshots R_Error

Desktop (please complete the following information):

Kazink36 commented 2 years ago

I believe cfbd_game_player_stats requires one of team or week along with the season. I'll double check with CFBD and clarify the docs. There does however seem to be an issue, which I'll investigate, with the columns returning as lists that will make handling a little tricky.

cfbfastR::cfbd_game_player_stats(2021,team = "Utah")
#> ── Game player stats data from CollegeFootballData.com ─────── cfbfastR 1.9.1 ──
#> ℹ Data updated: 2022-09-05 12:50:50 EDT
#> # A tibble: 1,085 × 32
#>      game_id team  conference home_…¹ points categ…² athle…³ name  c_att  yds   
#>        <int> <chr> <chr>      <chr>    <int> <chr>   <chr>   <chr> <list> <list>
#>  1 401309888 Utah  Pac-12     away        52 defens… 4243327 Bran… <NULL> <NULL>
#>  2 401309888 Utah  Pac-12     away        52 defens… 4243265 Alik… <NULL> <NULL>
#>  3 401309888 Utah  Pac-12     away        52 defens… 4569557 Miki… <NULL> <NULL>
#>  4 401309888 Utah  Pac-12     away        52 defens… 4875335 Brys… <NULL> <NULL>
#>  5 401309888 Utah  Pac-12     away        52 defens… 4574856 Hayd… <NULL> <NULL>
#>  6 401309888 Utah  Pac-12     away        52 defens… 4429067 Clar… <NULL> <NULL>
#>  7 401309888 Utah  Pac-12     away        52 defens… 4429727 Van … <NULL> <NULL>
#>  8 401309888 Utah  Pac-12     away        52 defens… 4687592 Jona… <NULL> <NULL>
#>  9 401309888 Utah  Pac-12     away        52 defens… 4361004 Vont… <NULL> <NULL>
#> 10 401309888 Utah  Pac-12     away        52 defens… 4676004 Cole… <NULL> <NULL>
#> # … with 1,075 more rows, 22 more variables: avg <list>, td <list>, int <list>,
#> #   qbr <list>, car <list>, long <list>, rec <list>, no <list>, fg <list>,
#> #   pct <list>, xp <list>, pts <list>, tb <list>, in_20 <list>, fum <list>,
#> #   lost <list>, tot <list>, solo <list>, sacks <list>, tfl <list>, pd <list>,
#> #   qb_hur <list>, and abbreviated variable names ¹​home_away, ²​category,
#> #   ³​athlete_id
#> # ℹ Use `print(n = ...)` to see more rows, and `colnames()` to see all variable names