dynastyprocess / data

An open-data fantasy football repository, maintained by DynastyProcess.com
https://dynastyprocess.com
GNU General Public License v3.0
73 stars 19 forks source link

Nick Williams & Randy Gregory espn_id contradiction #28

Open TheMathNinja opened 2 years ago

TheMathNinja commented 2 years ago

I think the Randy Gregory and Nick Williams espn_id variables might be wrong in dp_playerids(). I'm working on updating the espn_id and using the ffespn package, the only IDs that aren't matching are these two players. Not sure which is right/wrong.

remotes::install_github("dfs-with-r/ffespn")
remotes::install_github("ffverse/ffscrapr", ref = "dev")
remotes::install_github("nflverse/nflreadr")

library(tidyverse)
library(ffespn)
library(ffscrapr)
library(nflreadr)

espn_list <- bind_rows(ffespn_projections(2021, 0, "QB") %>% select(-notes),
                       ffespn_projections(2021, 0, "RB") %>% select(-notes),
                       ffespn_projections(2021, 0, "WR") %>% select(-notes),
                       ffespn_projections(2021, 0, "TE") %>% select(-notes),
                       ffespn_projections(2021, 0, "K") %>% select(-notes),
                       ffespn_projections(2021, 0, "P") %>% select(-notes),
                       ffespn_projections(2021, 0, "DT") %>% select(-notes),
                       ffespn_projections(2021, 0, "DE") %>% select(-notes),
                       ffespn_projections(2021, 0, "LB") %>% select(-notes),
                       ffespn_projections(2021, 0, "CB") %>% select(-notes),
                       ffespn_projections(2021, 0, "S") %>% select(-notes)
) %>%
  select(new_espn_id = id,
         name = player,
         team) %>%
  mutate(name = clean_player_names(name),
         team = clean_team_abbrs(team))

updated_playerids <- dp_playerids() %>%
  mutate(name = clean_player_names(name),
         team = clean_team_abbrs(team)) %>%
  left_join(.,
            espn_list,
                   by = c("name", "team")
  )

espn_match <- updated_playerids %>%
  select(name,
         team,
         position,
         espn_id,
         new_espn_id)
view(espn_match)

check <- espn_match %>%
  filter(!is.na(espn_id) & !is.na(new_espn_id) & espn_id != new_espn_id)

view(check)
tanho63 commented 2 years ago

Just noticed this issue. Got IDs in question? easier for me to poke at

TheMathNinja commented 2 years ago

Your df is showing Randy Gregory: 3895806 Nick Williams: 15882

Mine was showing Randy Gregory: 3040479 Nick Williams: 2317118

tanho63 commented 2 years ago

Hmm. It looks like these guys have two separate profiles: RG https://www.espn.com/nfl/player/stats/_/id/3895806 https://www.espn.com/nfl/player/stats/_/id/3040479

NW https://www.espn.com/nfl/player/stats/_/id/15882 https://www.espn.com/nfl/player/stats/_/id/2317118

Probably should be corrected via missing_ids.csv again

Tan Ho

On Mon, Sep 27, 2021 at 2:57 PM Mike Filicicchia @.***> wrote:

Your df is showing Randy Gregory: 3895806 Nick Williams: 15882

Mine was showing Randy Gregory: 3040479 Nick Williams: 2317118

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dynastyprocess/data/issues/28#issuecomment-928180440, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCRZ32DEVRMNSLYBKEACX3UEC5BPANCNFSM5EJMEE6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.