Comments (15)
Are you talking about depth charts @armstjc?
This seems to be true for all 32 teams. Thoughts @john-b-edwards?
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)
from nflreadr.
season_type
is also listed as "REG" for week 19
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
from nflreadr.
Yes. I was referring to depth charts.
from nflreadr.
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 {nflreadr}
documentation but otherwise not change the code.
from nflreadr.
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
{nflreadr}
documentation but otherwise not change the code.
I don't have a reprex currently but checked Number of teams in week 19 for all seasons and it was a bit weird.
>
30 for the seasons 2001:2003- 12 for the seasons 2004:2019
- 32 for 2020 and 2021
(or something close to that)
from nflreadr.
... also odd. I only checked 2020 and 2021
from nflreadr.
To be clear you're referencing week 18* for 2020 right? @mrcaseb
from nflreadr.
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.
from nflreadr.
... okay, gonna revert my PR then until we figure out what's going on.
from nflreadr.
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 season_type = 'REG'
.
I think my original intuition was correct, such that:
- Weeks 1-17/18 represent the depth charts for each game of the regular season.
- Week 18/19 represents an end-of-season depth chart for all regular season teams
- Week 19/20 represents the depth charts for the teams in the first week of the postseason.
Can probably clarify this further in the data dict.
from nflreadr.
I wrote some code to look at this and I think its a bit inconsistent
- week 18 is missing for <2006
- postseason is missing for 2005
- SB is week 22 for 2004, 2006, 2014
- week 20 mostly > week 19
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)
from nflreadr.
Oh lol whoops only read the PR
from nflreadr.
Happy to take further edits as necessary
from nflreadr.
@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:
- Drop end of season DC
- Re-order playoff DC such that WC week is week 1 instead of 19/20
Curious if anyone feels differently?
Can get to this later today after work.
from nflreadr.
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
from nflreadr.
Related Issues (20)
- Release nflreadr 1.3.1
- Export `cache_clear()` without the dot prefix so that it's more obvious to users HOT 4
- duplicate categories for fieldturf in "surface" variable of PBP data HOT 1
- dictionary_pbp typo HOT 1
- join_coalesce should warn if join columns are duplicated or any are NA
- [BUG] <nflreadr::load_pfr_advstats() returning a lot of duplicated rows> HOT 1
- change the desc of `special`? HOT 1
- Blank entries in participation formation variables differ for penalty plays by season HOT 2
- `nflverse_download()` should provide an argument to reload specific data from a release HOT 2
- `nflreadr::clean_homeaway()` overwrites location data HOT 3
- [BUG] <title>Team fields not updated for recently traded players HOT 2
- include_pbp option in load_participation missing plays HOT 4
- [BUG] load_injuries stopped working in week 13 HOT 2
- Ripleyed - due by 2023-01-09
- Release nflreadr 1.3.2
- [BUG] 2015 Roster Weeks Numbered Out of Order HOT 1
- [BUG] no Jalen Hurts for Philapdelphia Depth Chart (week 23) HOT 1
- hi, the sum of yards are not as same as pro-football-reference.com HOT 3
- [BUG] Oakland participation data missing for offense 2016-2019
- Most recent season is an idiot HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nflreadr.