Skip to content
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

[BUG] Calculate_Stats - Incorrect Total for Air Yards in Week 13 #499

Closed
2 tasks done
marvin3FF opened this issue Dec 3, 2024 · 0 comments · Fixed by #500
Closed
2 tasks done

[BUG] Calculate_Stats - Incorrect Total for Air Yards in Week 13 #499

marvin3FF opened this issue Dec 3, 2024 · 0 comments · Fixed by #500

Comments

@marvin3FF
Copy link

marvin3FF commented Dec 3, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Have you installed the latest development version of the package(s) in question?

  • I have installed the latest development version of the package.

If this is a data issue, have you tried clearing your nflverse cache?

I have cleared my nflverse cache and the issue persists.

What version of the package do you have?

5.0.0

Describe the bug

I noticed this issue specifically for the Giants receivers, but I'm now seeing it across a few other players/teams. When running calculate_stats, I noticed the air yards are coming through incorrectly. For example, Malik Nabers is coming through with -24 air yards, when the pbp data has him totaling 69 air yards.

Reprex

pbp_mod <- pbp %>%
  filter(rush_attempt == 1 | pass_attempt == 1) %>%
  filter(!is.na(epa))%>%
  filter(season_type == "REG")

weekly2 <- calculate_player_stats(pbp_mod, weekly=TRUE)%>%
  filter(player_name == "M.Nabers",
         week == 13,
         season == 2024)%>%
  group_by(player_name)%>%
  summarize(AY = sum(receiving_air_yards))

weekly <- calculate_stats(2024:2024, "week", "player", "REG")%>%
  filter(player_name == "M.Nabers",
         week == 13,
         season == 2024)%>%
  group_by(player_name)%>%
  summarize(AY = sum(receiving_air_yards))

Expected Behavior

Expected calculate_stats' air yards to match pbp_data.

nflverse_sitrep

── System Info ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
• R version 4.3.2 (2023-10-31) • Running under: macOS 15.0.1
── Package Status ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   package  installed  cran        dev behind
1   nfl4th 1.0.4.9005 1.0.4 1.0.4.9005       
2 nflfastR      5.0.0 5.0.0      5.0.0       
3 nflplotR 1.4.0.9001 1.4.0 1.4.0.9001       
4 nflreadr   1.4.1.06 1.4.1   1.4.1.06       
5 nflseedR 1.2.0.9901 1.2.0 1.2.0.9901       
6 nflverse      1.0.3 1.0.3      1.0.3       
── Package Options ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
• No options set for above packages
── Package Dependencies ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
• askpass     (1.2.1)   • gt          (0.11.1)   • purrr        (1.0.2)     
• backports   (1.5.0)   • gtable      (0.3.6)    • R6           (2.5.1)     
• base64enc   (0.1-3)   • highr       (0.11)     • rappdirs     (0.3.3)     
• bigD        (0.3.0)   • hms         (1.1.3)    • RColorBrewer (1.1-3)     
• bitops      (1.0-9)   • htmltools   (0.5.8.1)  • Rcpp         (1.0.13-1)  
• bslib       (0.8.0)   • htmlwidgets (1.6.4)    • reactable    (0.4.4)     
• cachem      (1.1.0)   • httr        (1.4.7)    • reactR       (0.6.1)     
• cli         (3.6.3)   • isoband     (0.2.7)    • rlang        (1.1.4)     
• codetools   (0.2-20)  • janitor     (2.2.0)    • rmarkdown    (2.29)      
• colorspace  (2.1-1)   • jquerylib   (0.1.4)    • rstudioapi   (0.17.1)    
• commonmark  (1.9.2)   • jsonlite    (1.8.9)    • sass         (0.4.9)     
• compiler    (4.3.2)   • juicyjuice  (0.1.0)    • scales       (1.3.0)     
• cpp11       (0.5.0)   • knitr       (1.49)     • snakecase    (0.11.1)    
• crayon      (1.5.3)   • labeling    (0.4.3)    • splines      (4.3.2)     
• curl        (6.0.1)   • lattice     (0.22-6)   • stats        (4.3.2)     
• data.table  (1.16.2)  • lifecycle   (1.0.4)    • stringi      (1.8.4)     
• digest      (0.6.37)  • listenv     (0.9.1)    • stringr      (1.5.1)     
• dplyr       (1.1.4)   • lubridate   (1.9.3)    • sys          (3.4.3)     
• evaluate    (1.0.1)   • magick      (2.8.5)    • tibble       (3.2.1)     
• fansi       (1.0.6)   • magrittr    (2.0.3)    • tidyr        (1.3.1)     
• farver      (2.1.2)   • markdown    (1.13)     • tidyselect   (1.2.1)     
• fastmap     (1.2.0)   • MASS        (7.3-60)   • timechange   (0.3.0)     
• fastrmodels (1.0.2)   • Matrix      (1.6-1.1)  • tinytex      (0.54)      
• fontawesome (0.5.3)   • memoise     (2.0.1)    • tools        (4.3.2)     
• fs          (1.6.5)   • methods     (4.3.2)    • utf8         (1.2.4)     
• furrr       (0.3.1)   • mgcv        (1.9-1)    • utils        (4.3.2)     
• future      (1.34.0)  • mime        (0.12)     • V8           (6.0.0)     
• generics    (0.1.3)   • munsell     (0.5.1)    • vctrs        (0.6.5)     
• ggpath      (1.0.2)   • nlme        (3.1-166)  • viridisLite  (0.4.2)     
• ggplot2     (3.5.1)   • openssl     (2.2.2)    • withr        (3.0.2)     
• globals     (0.16.3)  • parallel    (4.3.2)    • xfun         (0.49)      
• glue        (1.8.0)   • parallelly  (1.39.0)   • xgboost      (1.7.8.1)   
• graphics    (4.3.2)   • pillar      (1.9.0)    • xml2         (1.3.6)     
• grDevices   (4.3.2)   • pkgconfig   (2.0.3)    • yaml         (2.3.10)    
• grid        (4.3.2)   • progressr   (0.15.1)     
• gsubfn      (0.7)     • proto       (1.0.0)

Screenshots

No response

Additional context

No response

@mrcaseb mrcaseb transferred this issue from nflverse/nflreadr Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant