Adding missing ESPN ID's to Player ID's map
TheMathNinja opened this issue · 3 comments
TheMathNinja commented
remotes::install_github("dfs-with-r/ffespn")
library(ffscrapr)
library(ffespn)
library(tidyverse)
#Build df listing all ESPN position designations at current moment.
espnqblist_2022 <- ffespn_projections(2022, 0, "QB", league_id = espn_league_id_2022) %>%
select(id:position)
espnrblist_2022 <- ffespn_projections(2022, 0, "RB", league_id = espn_league_id_2022) %>%
select(id:position)
espnwrlist_2022 <- ffespn_projections(2022, 0, "WR", league_id = espn_league_id_2022) %>%
select(id:position)
espntelist_2022 <- ffespn_projections(2022, 0, "TE", league_id = espn_league_id_2022) %>%
select(id:position)
espnpklist_2022 <- ffespn_projections(2022, 0, "K", league_id = espn_league_id_2022) %>%
select(id:position)
espnpnlist_2022 <- ffespn_projections(2022, 0, "P", league_id = espn_league_id_2022) %>%
select(id:position)
espndtlist_2022 <- ffespn_projections(2022, 0, "DT", league_id = espn_league_id_2022) %>%
select(id:position)
espndelist_2022 <- ffespn_projections(2022, 0, "DE", league_id = espn_league_id_2022) %>%
select(id:position)
espnlblist_2022 <- ffespn_projections(2022, 0, "LB", league_id = espn_league_id_2022) %>%
select(id:position)
espncblist_2022 <- ffespn_projections(2022, 0, "CB", league_id = espn_league_id_2022) %>%
select(id:position)
espnslist_2022 <- ffespn_projections(2022, 0, "S", league_id = espn_league_id_2022) %>%
select(id:position)
espnlist_2022 <- bind_rows(espnqblist_2022,
espnrblist_2022,
espnwrlist_2022,
espntelist_2022,
espnpklist_2022,
espnpnlist_2022,
espndtlist_2022,
espndelist_2022,
espnlblist_2022,
espncblist_2022,
espnslist_2022) %>%
rename(espn_id = id,
espn_pos = position,
espn_team = team)
#Update ffscrapr's ESPN ID's by building df w/ missing IDs (usually rookies)
espn_id_adds <- dp_playerids() %>%
rename(dp_espn_id = espn_id,
player = name) %>%
full_join(., y = espnlist_2022,
by = c("player")) %>%
select(player,
position,
espn_pos,
team,
espn_team,
dp_espn_id,
espn_id) %>%
filter(espn_id %in% dp_espn_id == FALSE)
yields 228 updates to ESPN ID's ("OAK" Sam Williams needs no updating). Please add!
tanho63 commented
Adding to backlog as a feature request.
If you want to help, you'll need to (figure out how to) map the ESPN IDs in question to an MFL ID and then update this CSV with a PR: https://github.com/dynastyprocess/data/blob/master/files/missing_ids.csv
I probably will not have time to look at this in the near future.
TheMathNinja commented
dp_missing_ids_update_2022.csv
I've got the new CSV here. Would you be willing to do the pull?
TheMathNinja commented
I'll attempt it but something tells me it might not go right.