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

Extra team in 2016? #48

Closed
Auburngrads opened this issue Oct 17, 2017 · 1 comment
Closed

Extra team in 2016? #48

Auburngrads opened this issue Oct 17, 2017 · 1 comment

Comments

@Auburngrads
Copy link

Auburngrads commented Oct 17, 2017

This may be an issue with the NFL API but the data contained in the package and the data retrieved using the package for the 2016 season includes 33 teams (not 32). Seems that data is recorded for the Jacksonville Jaguars as both 'JAC' and 'JAX'. This only seems to affect the 2016 season.

length(unique(nflscrapR::playerstats15$Team)) ## returns 33
length(unique(nflscrapR::playerstats16$Team)) ## returns 34

This is probably an error caused by how the NFL entered the data, but you may want to update the playerstats16 dataset.

@sventura
Copy link

Here's a fix that should clean up the team abbreviations:

    library(tidyverse)
    mutate(data, 
           posteam = case_when(
             posteam == "SD" ~ "LAC",
             posteam == "LA" ~ "LAR",
             posteam == "STL" ~ "LAR",
             posteam == "JAC" ~ "JAX", 
             TRUE ~ posteam
           ))

Of course, some users might want to keep the SD and STL abbreviations.

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

3 participants