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
ff_starters.espn_conn() Player Projected Score Incorrect Sometimes #397
Comments
Nice find - and thank you for the reprex + proposed fix! Looks good, my only modifications are to extract the statSourceId first and then pass the index into the retrieval function. ... %>%
tidyr::hoist("player",
"eligible_lineup_slots" = "eligibleSlots",
"player_name" = "fullName",
"pos" = "defaultPositionId",
"team" = "proTeamId",
"stats" = "stats"
) %>%
dplyr::mutate(
which_source_is_projection = purrr::map(
.data$stats,
# projections are statSourceId == 1
# per <https://github.com/ffverse/ffscrapr/issues/397>
~ which(purrr::map(.x, "statSourceId") == 1)
),
projected_score = purrr::map2_dbl(
.data$stats,
.data$which_source_is_projection,
~ {if(length(.y)==0) return(NA_real_) else purrr::pluck(.x, .y, "appliedTotal", .default = NA_real_)}),
player = NULL,
stats = NULL,
which_source_is_projection = NULL
) |
tanho63
added a commit
that referenced
this issue
Jun 26, 2023
tanho63
added a commit
that referenced
this issue
Jun 26, 2023
tanho63
added a commit
that referenced
this issue
Jun 26, 2023
If you reinstall from github, this should now be resolved - feel free to reopen/open a new issue otherwise! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
In ff_starters(), for espn leagues the projected player score is the same as the actual player score about 23% of the time due to the assumption "assume stats list col returns actual as first list and projected as second" written in the .espn_week_starter function in espn_starters.R
Funnily enough, you predicted this being an issue when it was first implemented
#323 (comment)
Reprex
Expected behavior
The projected score to be correct, such as below
Session information
Screenshots
Current code that causes the issue:
Additional context
My current solution to the issue:
The text was updated successfully, but these errors were encountered: