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

Incorrect team names in playstats of all Jaguars home games from 2001 to 2002 #92

Open
mrcaseb opened this issue Jul 18, 2024 · 1 comment

Comments

@mrcaseb
Copy link
Member

mrcaseb commented Jul 18, 2024

It is a known bug that raw pbp json data lists incorrect team names in Jaguars home games from 2001 to 2015. We try to catch this in nflfastR but it's not perfect (see nflverse/nflfastR#474).

We probably should try to update those files to get rid of the issue

library(dplyr, warn.conflicts = FALSE)

problematic_games <- nflfastR:::load_playstats(TRUE) %>% 
  group_by(game_id) %>% 
  filter(n_distinct(team_abbr, na.rm = TRUE) < 2) %>% 
  pull(game_id) %>% 
  unique()

problematic_games
#>   [1] "2001_01_PIT_JAX" "2001_02_TEN_JAX" "2001_03_CLE_JAX" "2001_06_BUF_JAX"
#>   [5] "2001_09_CIN_JAX" "2001_11_BAL_JAX" "2001_12_GB_JAX"  "2001_16_KC_JAX" 
#>   [9] "2002_01_IND_JAX" "2002_04_NYJ_JAX" "2002_05_PHI_JAX" "2002_08_HOU_JAX"
#>  [13] "2002_10_WAS_JAX" "2002_13_PIT_JAX" "2002_14_CLE_JAX" "2002_16_TEN_JAX"
#>  [17] "2003_02_BUF_JAX" "2003_05_SD_JAX"  "2003_06_MIA_JAX" "2003_08_TEN_JAX"
#>  [21] "2003_10_IND_JAX" "2003_13_TB_JAX"  "2003_14_HOU_JAX" "2003_16_NO_JAX" 
#>  [25] "2004_02_DEN_JAX" "2004_04_IND_JAX" "2004_06_KC_JAX"  "2004_10_DET_JAX"
#>  [29] "2004_11_TEN_JAX" "2004_13_PIT_JAX" "2004_14_CHI_JAX" "2004_16_HOU_JAX"
#>  [33] "2005_01_SEA_JAX" "2005_04_DEN_JAX" "2005_05_CIN_JAX" "2005_09_HOU_JAX"
#>  [37] "2005_10_BAL_JAX" "2005_14_IND_JAX" "2005_15_SF_JAX"  "2005_17_TEN_JAX"
#>  [41] "2006_01_DAL_JAX" "2006_02_PIT_JAX" "2006_05_NYJ_JAX" "2006_09_TEN_JAX"
#>  [45] "2006_10_HOU_JAX" "2006_11_NYG_JAX" "2006_14_IND_JAX" "2006_16_NE_JAX" 
#>  [49] "2007_01_TEN_JAX" "2007_02_ATL_JAX" "2007_06_HOU_JAX" "2007_07_IND_JAX"
#>  [53] "2007_11_SD_JAX"  "2007_12_BUF_JAX" "2007_14_CAR_JAX" "2007_16_OAK_JAX"
#>  [57] "2008_02_BUF_JAX" "2008_04_HOU_JAX" "2008_05_PIT_JAX" "2008_08_CLE_JAX"
#>  [61] "2008_11_TEN_JAX" "2008_12_MIN_JAX" "2008_15_GB_JAX"  "2008_16_IND_JAX"
#>  [65] "2009_02_ARI_JAX" "2009_04_TEN_JAX" "2009_06_STL_JAX" "2009_09_KC_JAX" 
#>  [69] "2009_11_BUF_JAX" "2009_13_HOU_JAX" "2009_14_MIA_JAX" "2009_15_IND_JAX"
#>  [73] "2010_01_DEN_JAX" "2010_03_PHI_JAX" "2010_04_IND_JAX" "2010_06_TEN_JAX"
#>  [77] "2010_10_HOU_JAX" "2010_11_CLE_JAX" "2010_14_OAK_JAX" "2010_16_WAS_JAX"
#>  [81] "2011_01_TEN_JAX" "2011_04_NO_JAX"  "2011_05_CIN_JAX" "2011_07_BAL_JAX"
#>  [85] "2011_12_HOU_JAX" "2011_13_SD_JAX"  "2011_14_TB_JAX"  "2011_17_IND_JAX"
#>  [89] "2012_02_HOU_JAX" "2012_04_CIN_JAX" "2012_05_CHI_JAX" "2012_09_DET_JAX"
#>  [93] "2012_10_IND_JAX" "2012_12_TEN_JAX" "2012_14_NYJ_JAX" "2012_16_NE_JAX" 
#>  [97] "2013_01_KC_JAX"  "2013_04_IND_JAX" "2013_07_SD_JAX"  "2013_08_SF_JAX" 
#> [101] "2013_11_ARI_JAX" "2013_14_HOU_JAX" "2013_15_BUF_JAX" "2013_16_TEN_JAX"
#> [105] "2014_03_IND_JAX" "2014_05_PIT_JAX" "2014_07_CLE_JAX" "2014_08_MIA_JAX"
#> [109] "2014_10_DAL_JAX" "2014_13_NYG_JAX" "2014_14_HOU_JAX" "2014_16_TEN_JAX"
#> [113] "2015_01_CAR_JAX" "2015_02_MIA_JAX" "2015_06_HOU_JAX" "2015_07_BUF_JAX"
#> [117] "2015_11_TEN_JAX" "2015_12_SD_JAX"  "2015_14_IND_JAX" "2015_15_ATL_JAX"

season_table <- problematic_games %>% 
  substr(1,4) %>% 
  table()

season_table
#> 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 
#>    8    8    8    8    8    8    8    8    8    8    8    8    8    8    8
@mrcaseb
Copy link
Member Author

mrcaseb commented Sep 17, 2024

Problem reduced to 2001 and 2002 seasons

problematic_games
 [1] "2001_01_PIT_JAX" "2001_02_TEN_JAX" "2001_03_CLE_JAX" "2001_06_BUF_JAX" "2001_09_CIN_JAX" "2001_11_BAL_JAX"
 [7] "2001_12_GB_JAX"  "2001_16_KC_JAX"  "2002_01_IND_JAX" "2002_04_NYJ_JAX" "2002_05_PHI_JAX" "2002_08_HOU_JAX"
[13] "2002_10_WAS_JAX" "2002_13_PIT_JAX" "2002_14_CLE_JAX" "2002_16_TEN_JAX"

@mrcaseb mrcaseb changed the title Incorrect team names in playstats of all Jaguars home games from 2001 to 2015 Incorrect team names in playstats of all Jaguars home games from 2001 to 2002 Sep 17, 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

No branches or pull requests

1 participant