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

fantasy_points_ppr variable in load_player_stats() function doesn't include ST points #203

Closed
SCasanova opened this issue Feb 27, 2021 · 1 comment · Fixed by #204
Closed
Labels
bug Something isn't working

Comments

@SCasanova
Copy link

There are point disparities between what load_player_stats() reports as PPR fantasy points and official numbers for unaccounted special teams plays. For example 2020 AJ Brown shows 210.4 points instead of 216.4 points due to the missing onside kick recover TD

@guga31bb
Copy link
Member

Yep CeeDee Lamb had one of those too. Comparing with this leaderboard, we're 6 points short for both:

nflfastR::load_pbp(2020) %>%
    dplyr::filter(week <= 17) %>%
    nflfastR::calculate_player_stats() %>%
    dplyr::mutate(
        ppg = fantasy_points_ppr / games
    ) %>%
    filter(games > 5) %>%
    # only keep the WRs
    inner_join(
        nflfastR::fast_scraper_roster(2020) %>% filter(position == "WR") %>% select(gsis_id),
        by = c("player_id" = "gsis_id")
    ) %>%
    dplyr::arrange(-ppg) %>%
    dplyr::select(player_name, recent_team, games, fantasy_points_ppr, ppg) %>%
    dplyr::filter(recent_team %in% c("DAL", "TEN"))

# A tibble: 10 x 5
   player_name recent_team games fantasy_points_ppr   ppg
   <chr>       <chr>       <int>              <dbl> <dbl>
 1 A.Brown     TEN            14              242.  17.2 
 2 A.Cooper    DAL            16              237.  14.8 
 3 C.Davis     TEN            14              191.  13.7 
 4 C.Lamb      DAL            16              212.  13.2 
 5 M.Gallup    DAL            16              173.  10.8 
 6 A.Humphries TEN             7               57.8  8.26
 7 C.Wilson    DAL            10               51.6  5.16
 8 K.Raymond   TEN             8               27.4  3.42
 9 C.Batson    TEN             9               30    3.33
10 N.Brown     DAL             9               29.8  3.31

@guga31bb guga31bb added the bug Something isn't working label Feb 27, 2021
mrcaseb added a commit that referenced this issue Mar 1, 2021
@mrcaseb mrcaseb linked a pull request Mar 1, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants