-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add documentation about season-ending depth charts to load_depth_charts data dictionary #78
Comments
Are you talking about depth charts @armstjc? nflreadr::load_depth_charts(2021) |>
dplyr::filter(week == 19) |>
dplyr::count(team)
#> # A tibble: 32 x 2
#> team n
#> <chr> <int>
#> 1 ARI 58
#> 2 ATL 53
#> 3 BAL 62
#> 4 BUF 55
#> 5 CAR 52
#> 6 CHI 55
#> 7 CIN 48
#> 8 CLE 48
#> 9 DAL 51
#> 10 DEN 57
#> # ... with 22 more rows Created on 2022-01-12 by the reprex package (v2.0.1) |
nflreadr::load_depth_charts(2021) |>
dplyr::filter(week == 19) |>
dplyr::count(team, season_type)
#> # A tibble: 32 x 3
#> team season_type n
#> <chr> <chr> <int>
#> 1 ARI REG 58
#> 2 ATL REG 53
#> 3 BAL REG 62
#> 4 BUF REG 55
#> 5 CAR REG 52
#> 6 CHI REG 55
#> 7 CIN REG 48
#> 8 CLE REG 48
#> 9 DAL REG 51
#> 10 DEN REG 57
#> # ... with 22 more rows |
Yes. I was referring to depth charts. |
There appears to be a week 19 for all teams' depth charts from the NFL API. There is also a week 18 listed for the 2020 regular season (which was a 17 week season) and I presume other seasons as well. My best guess is that this is some sort of end-of-season depth chart -- i.e. John Bates is listed as TE1 for the WFT for Week 19, 2021 instead of Ricky Seals-Jones -- Seals-Jones was inactive for week 18 and Bates was on the field for 100% of snaps Week 18. I think we should make a note of this in the |
I don't have a reprex currently but checked Number of teams in week 19 for all seasons and it was a bit weird.
|
... also odd. I only checked 2020 and 2021 |
To be clear you're referencing week 18* for 2020 right? @mrcaseb |
No I don't. That's the fun thing. I did week 19 because of laziness. Changed it afterwards to season_type == "REG" which removed 2021 completely of course but kept the higher numbers for the earlier seasons. |
... okay, gonna revert my PR then until we figure out what's going on. |
I only see 12* teams for 2020, and they're listed as postseason teams. nflreadr::load_depth_charts(2020) |>
dplyr::filter(week == 19)
#> # A tibble: 733 x 13
#> season week team season_type position depth_chart_pos~ formation depth_team
#> <int> <int> <chr> <chr> <chr> <chr> <chr> <int>
#> 1 2020 19 BUF POST OLB WLB Defense 2
#> 2 2020 19 BUF POST CB NCB Defense 1
#> 3 2020 19 BUF POST SS S Defense 1
#> 4 2020 19 BUF POST FS S Defense 1
#> 5 2020 19 BUF POST WR PR Special ~ 2
#> 6 2020 19 BUF POST WR KOR Special ~ 2
#> 7 2020 19 BUF POST T LT Offense 1
#> 8 2020 19 BUF POST G LG Offense 2
#> 9 2020 19 BUF POST C C Offense 1
#> 10 2020 19 BUF POST G RG Offense 2
#> # ... with 723 more rows, and 5 more variables: jersey_number <int>,
#> # full_name <chr>, first_name <chr>, last_name <chr>, gsis_id <chr>
nflreadr::load_depth_charts(2020) |>
dplyr::filter(week == 19) |>
dplyr::pull(team) |>
unique()
#> [1] "BUF" "CHI" "BAL" "TEN" "IND" "LA" "NO" "PIT" "SEA" "TB" "WAS" "CLE" Meanwhile week 18 for 2020 has 32 teams with I think my original intuition was correct, such that:
Can probably clarify this further in the data dict. |
I wrote some code to look at this and I think its a bit inconsistent
library(dplyr, warn.conflicts = FALSE)
library(ggplot2)
df <- nflreadr::load_depth_charts(TRUE)
df |>
group_by(season, week, team) |>
summarise() |>
ungroup() |>
count(season, week) |>
mutate(alpha = ifelse(n == 32, 0.2, 1)) |>
ggplot(aes(x = season, y = week)) +
geom_text(aes(label = n, alpha = alpha), size = 3) +
scale_alpha_identity() +
scale_y_continuous(breaks = scales::breaks_pretty(n = 10)) +
theme_minimal()
#> `summarise()` has grouped output by 'season', 'week'. You can override using the `.groups` argument. Created on 2022-01-12 by the reprex package (v2.0.1) |
Oh lol whoops only read the PR |
Happy to take further edits as necessary |
@mrcaseb great stuff, that really clarifies it. So my above comment holds true but only for 2007-2013, and 2015-2021. Seems like it may involve some data munging to get this into something resembling a consistent format? My thought is:
Curious if anyone feels differently? Can get to this later today after work. |
I think we should discuss this in a separate nflfastr-roster issue as the code that creates this lives there. The SB week issue is based on the fact that the max regular season week in these seasons is 17 compared to 18 in the other seasons. I will open a new issue with the above code |
See title.Washington Football Team Credited for a 2021 Week 19 game, despite missing the postseason
The text was updated successfully, but these errors were encountered: